aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-02 05:22:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-03 03:40:58 +0200
commitd18d48def6472e0572ccf22ae0105a3d1f45d3f9 (patch)
treea5ab2e3d7d690eb06eaba39782c90206b678d46d
parent8df77c37584a01bcd8ac90ed4fe4d51856935cf4 (diff)
downloadffmpeg-d18d48def6472e0572ccf22ae0105a3d1f45d3f9.tar.gz
avformat/swfdec: Use side data to communicate w/h changes to the decoder
Fixes reading from freed data Fixes part of Ticket3539 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 1c55d0ff3202a04ebc67a72d72391104e9bdb633) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/swfdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index c95b18ec6c..babaaa182f 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -353,11 +353,15 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
st = vst;
}
- st->codec->width = width;
- st->codec->height = height;
if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) < 0)
goto bitmap_end;
+ if (!st->codec->width && !st->codec->height) {
+ st->codec->width = width;
+ st->codec->height = height;
+ } else {
+ ff_add_param_change(pkt, 0, 0, 0, width, height);
+ }
pkt->pos = pos;
pkt->stream_index = st->index;