aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-21 15:00:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-22 22:53:11 +0100
commit02d1efdd5b61cefb96562ff9b94c03486a8ead15 (patch)
treee346846018dd4246b687117abfac25fe1bb51ec8 /libavcodec
parent469cb61193861baf46cce76f98985b026b08cd8d (diff)
downloadffmpeg-02d1efdd5b61cefb96562ff9b94c03486a8ead15.tar.gz
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@gmx.at> (cherry picked from commit bdeb61ccc67911cfc5e20c7cfb1312d0501ca90a) Conflicts: libavcodec/h264_ps.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index a68645bc36..f8439b110c 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -385,7 +385,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;