diff options
author | Matthew Waters <matthew@centricular.com> | 2020-12-02 15:43:15 +1100 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-02-17 03:41:28 +0000 |
commit | 1d33d1c8eaece0d02c4352fc0e663b3628cc42d1 (patch) | |
tree | 6f2efc613365d09438148b149faaf993170c2601 /ext | |
parent | f166c9d2348f24a1567f967317193067fc5975b2 (diff) | |
download | gst-libav-1d33d1c8eaece0d02c4352fc0e663b3628cc42d1.tar.gz |
avviddec: take the maximum of the height/coded_height
Otherwise, some h.264 streams (particularly with cropping information)
may cause memory corruption after a renegotiation to a smaller size when
decoded and then ffmpeg writes past the end of the buffer.
Fixes: https://gitlab.freedesktop.org/gstreamer/gst-libav/-/issues/80
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/110>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/libav/gstavviddec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index fbcd08c..a0a9dab 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -682,7 +682,7 @@ gst_ffmpegvideodec_prepare_dr_pool (GstFFMpegVidDec * ffmpegdec, gsize max_align; width = GST_VIDEO_INFO_WIDTH (info); - height = GST_VIDEO_INFO_HEIGHT (info); + height = MAX (GST_VIDEO_INFO_HEIGHT (info), ffmpegdec->context->coded_height); /* let ffmpeg find the alignment and padding */ avcodec_align_dimensions2 (ffmpegdec->context, &width, &height, |