mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit '8a2250344b19a343d830a902dbcf4c0b929ea49b'
* commit '8a2250344b19a343d830a902dbcf4c0b929ea49b': jv: detect partial packets in the demuxer Conflicts: libavformat/jvdec.c See:9d0c71e5e3
See:b948ab8132
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
abb6821e43
@ -184,17 +184,22 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
case JV_VIDEO:
|
case JV_VIDEO:
|
||||||
jv->state++;
|
jv->state++;
|
||||||
if (jvf->video_size || jvf->palette_size) {
|
if (jvf->video_size || jvf->palette_size) {
|
||||||
|
int ret;
|
||||||
int size = jvf->video_size + jvf->palette_size;
|
int size = jvf->video_size + jvf->palette_size;
|
||||||
if (av_new_packet(pkt, size + JV_PREAMBLE_SIZE))
|
if (av_new_packet(pkt, size + JV_PREAMBLE_SIZE))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
AV_WL32(pkt->data, jvf->video_size);
|
AV_WL32(pkt->data, jvf->video_size);
|
||||||
pkt->data[4] = jvf->video_type;
|
pkt->data[4] = jvf->video_type;
|
||||||
if ((size = avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size)) < 0)
|
ret = avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size);
|
||||||
return AVERROR(EIO);
|
if (ret < 0)
|
||||||
memset(pkt->data + JV_PREAMBLE_SIZE + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
return ret;
|
||||||
|
if (ret < size) {
|
||||||
pkt->size = size + JV_PREAMBLE_SIZE;
|
memset(pkt->data + JV_PREAMBLE_SIZE + ret, 0,
|
||||||
|
FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
pkt->flags |= AV_PKT_FLAG_CORRUPT;
|
||||||
|
}
|
||||||
|
pkt->size = ret + JV_PREAMBLE_SIZE;
|
||||||
pkt->stream_index = 1;
|
pkt->stream_index = 1;
|
||||||
pkt->pts = jv->pts;
|
pkt->pts = jv->pts;
|
||||||
if (jvf->video_type != 1)
|
if (jvf->video_type != 1)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
0, 5, 5, 1, 13940, 0x064c350a
|
0, 5, 5, 1, 13940, 0x064c350a
|
||||||
0, 6, 6, 1, 14418, 0x078d2dd2
|
0, 6, 6, 1, 14418, 0x078d2dd2
|
||||||
0, 7, 7, 1, 14539, 0x145167ed
|
0, 7, 7, 1, 14539, 0x145167ed
|
||||||
0, 8, 8, 1, 2552, 0xcf2b1db7
|
0, 8, 8, 1, 2552, 0xcf2b1db7, F=0x3
|
||||||
1, 131072, 131072, 1764, 1764, 0x30be734d
|
1, 131072, 131072, 1764, 1764, 0x30be734d
|
||||||
1, 132836, 132836, 1764, 1764, 0xa4c873a7
|
1, 132836, 132836, 1764, 1764, 0xa4c873a7
|
||||||
1, 134600, 134600, 1764, 1764, 0xd5f17443
|
1, 134600, 134600, 1764, 1764, 0xd5f17443
|
||||||
|
Loading…
Reference in New Issue
Block a user