summaryrefslogtreecommitdiffstats
path: root/libavformat/ipmovie.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-11-01 17:02:26 +0100
committerPaul B Mahol <onemda@gmail.com>2015-11-02 08:44:05 +0100
commitc293ef258cbb2c058e23651a26edf46e3bc05050 (patch)
tree2e3fccb306b4fb0ed855295c6caf6e466d67360a /libavformat/ipmovie.c
parentdee74405312a13a96ae8259221a79a0e78ea7789 (diff)
downloadffmpeg-streaming-c293ef258cbb2c058e23651a26edf46e3bc05050.zip
ffmpeg-streaming-c293ef258cbb2c058e23651a26edf46e3bc05050.tar.gz
avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
The size of decoding map can differ from one calculated internally, producing artifacts while decoding video. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/ipmovie.c')
-rw-r--r--libavformat/ipmovie.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 99b193d..df9b8f0 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -156,7 +156,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
/* send both the decode map and the video data together */
- if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))
+ if (av_new_packet(pkt, 2 + s->decode_map_chunk_size + s->video_chunk_size))
return CHUNK_NOMEM;
if (s->has_palette) {
@@ -178,7 +178,8 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
s->decode_map_chunk_offset = 0;
- if (avio_read(pb, pkt->data, s->decode_map_chunk_size) !=
+ AV_WL16(pkt->data, s->decode_map_chunk_size);
+ if (avio_read(pb, pkt->data + 2, s->decode_map_chunk_size) !=
s->decode_map_chunk_size) {
av_packet_unref(pkt);
return CHUNK_EOF;
@@ -187,7 +188,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
avio_seek(pb, s->video_chunk_offset, SEEK_SET);
s->video_chunk_offset = 0;
- if (avio_read(pb, pkt->data + s->decode_map_chunk_size,
+ if (avio_read(pb, pkt->data + 2 + s->decode_map_chunk_size,
s->video_chunk_size) != s->video_chunk_size) {
av_packet_unref(pkt);
return CHUNK_EOF;
OpenPOWER on IntegriCloud