diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-11-28 10:54:35 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-02-02 12:48:16 -0500 |
commit | 716ee73c991cfa4a8a49670e2650ebd0e2d34df8 (patch) | |
tree | eff95c76915fca76de97da589732ba56e4f3b33f | |
parent | 979f77b0dc40571761999633a38d97be9a1670c8 (diff) | |
download | ffmpeg-716ee73c991cfa4a8a49670e2650ebd0e2d34df8.tar.gz |
h264: reset num_reorder_frames if it is invalid
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 9ecabd7892ff073ae60ded3fc0a1290f5914ed5c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Conflicts:
libavcodec/h264_ps.c
(cherry picked from commit 299c5dcfb0cd3debdf07943edfb46f4aeb02ca91)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/h264_ps.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index 00c5003a22..ee4711c147 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -236,7 +236,9 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){ } if(sps->num_reorder_frames > 16U /*max_dec_frame_buffering || max_dec_frame_buffering > 16*/){ - av_log(h->s.avctx, AV_LOG_ERROR, "illegal num_reorder_frames %d\n", sps->num_reorder_frames); + av_log(h->s.avctx, AV_LOG_ERROR, "Clipping illegal num_reorder_frames %d\n", + sps->num_reorder_frames); + sps->num_reorder_frames = 16; return -1; } } |