diff options
author | Michael Niedermayer <[email protected]> | 2014-09-02 05:22:26 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2014-09-07 13:41:13 +0200 |
commit | 248a2fca908478d5036c8f5e418e2ead41b2f0a6 (patch) | |
tree | 6bd481065d96acf6a451226136e6dcf21d13eaff /libavformat/swfdec.c | |
parent | 1482253790c61ccb3e042b07cbc288c4d79637e5 (diff) |
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 <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 1c55d0ff3202a04ebc67a72d72391104e9bdb633)
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit a9734e7d3017ffc9539eaac2a8acce3ad427f746)
Signed-off-by: Michael Niedermayer <[email protected]>
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r-- | libavformat/swfdec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 54e0f6dc0e..00926c8274 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -347,11 +347,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; |