aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-06 04:11:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-17 19:43:18 +0100
commiteca1e3dcc8473bc6b51e91d2a80c8bc13fbaa5b3 (patch)
tree9b35e40685d8f00f90956dcca0d703c06a5f9388 /libavcodec
parent7c3a3d47cf7f5d45a7f794b9509a907161d27f64 (diff)
downloadffmpeg-eca1e3dcc8473bc6b51e91d2a80c8bc13fbaa5b3.tar.gz
avcodec/h264_ps: More completely check the bit depths
Fixes out of array read Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 69aa79365c1e8e1cb597d33e77bf1062c2ef47d4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_ps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 603f1681e3..81ace9f52d 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -383,7 +383,8 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
"Different chroma and luma bit depth");
goto fail;
}
- if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
+ if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 ||
+ sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14) {
av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
sps->bit_depth_luma, sps->bit_depth_chroma);
goto fail;