Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-21 18:00:59 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-02-21 18:02:09 +0400
commitbdeb61ccc67911cfc5e20c7cfb1312d0501ca90a (patch)
tree3e7121c246e0130a36b8bedbd728b9f191da8830 /libavcodec/h264_ps.c
parent59015c1118ac70b883ab5a85f5766a7115fba60f (diff)
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>
Diffstat (limited to 'libavcodec/h264_ps.c')
-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 49ba82ec60..257529328f 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -380,7 +380,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
}
sps->bit_depth_luma = get_ue_golomb(&h->gb) + 8;
sps->bit_depth_chroma = get_ue_golomb(&h->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->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
sps->bit_depth_luma, sps->bit_depth_chroma);
goto fail;