[FFmpeg-cvslog] h264: check that luma and chroma depth match

Michael Niedermayer git at videolan.org
Sun Mar 3 03:35:52 CET 2013


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Thu Feb 21 15:00:59 2013 +0100| [676df8c4c70c67f8f31a439f8ab301f7de3fe977] | committer: Michael Niedermayer

h264: check that luma and chroma depth match

Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit bdeb61ccc67911cfc5e20c7cfb1312d0501ca90a)

Conflicts:

	libavcodec/h264_ps.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=676df8c4c70c67f8f31a439f8ab301f7de3fe977
---

 libavcodec/h264_ps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index cdc6b07..02654c1 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -381,7 +381,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
         }
         sps->bit_depth_luma   = get_ue_golomb(&s->gb) + 8;
         sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8;
-        if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
+        if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U || sps->bit_depth_luma != sps->bit_depth_chroma) {
             av_log(h->s.avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
                    sps->bit_depth_luma, sps->bit_depth_chroma);
             goto fail;



More information about the ffmpeg-cvslog mailing list