summaryrefslogtreecommitdiffstats
path: root/libavcodec/hevc_ps.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-27 23:59:09 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-29 21:16:32 +0200
commit2a83866c9f9531eb096c9b9fe0550e742b931ad1 (patch)
treeabe803ec4db01e0c6adbdf4f5e8f9d3a9dc87d49 /libavcodec/hevc_ps.c
parent6def8b8d924af985514ebb1b1a51871c94d26d33 (diff)
downloadffmpeg-streaming-2a83866c9f9531eb096c9b9fe0550e742b931ad1.zip
ffmpeg-streaming-2a83866c9f9531eb096c9b9fe0550e742b931ad1.tar.gz
avcodec/hevc_ps: Fix undefined shift in pcm code
Fixes: runtime error: shift exponent -1 is negative Fixes: 3091/clusterfuzz-testcase-minimized-6229767969832960 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc_ps.c')
-rw-r--r--libavcodec/hevc_ps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 37eae22..ee31cc0 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1028,10 +1028,10 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
sps->pcm.log2_min_pcm_cb_size = get_ue_golomb_long(gb) + 3;
sps->pcm.log2_max_pcm_cb_size = sps->pcm.log2_min_pcm_cb_size +
get_ue_golomb_long(gb);
- if (sps->pcm.bit_depth > sps->bit_depth) {
+ if (FFMAX(sps->pcm.bit_depth, sps->pcm.bit_depth_chroma) > sps->bit_depth) {
av_log(avctx, AV_LOG_ERROR,
- "PCM bit depth (%d) is greater than normal bit depth (%d)\n",
- sps->pcm.bit_depth, sps->bit_depth);
+ "PCM bit depth (%d, %d) is greater than normal bit depth (%d)\n",
+ sps->pcm.bit_depth, sps->pcm.bit_depth_chroma, sps->bit_depth);
return AVERROR_INVALIDDATA;
}
OpenPOWER on IntegriCloud