X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fhevc.c;h=3170d8496eccb02cd5cee6bf01873c9279ec65be;hb=bf10f09bccdcfdb41b9f5bbae01d55961bfd0693;hp=32724854862620e8d64424a90c90edea34a9d251;hpb=3787495e1f2c2e2de333cf452021822c2655c8d0;p=ffmpeg diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 32724854862..3170d8496ec 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -740,6 +740,12 @@ static int hls_slice_header(HEVCContext *s) return AVERROR_INVALIDDATA; } + if (get_bits_left(gb) < 0) { + av_log(s->avctx, AV_LOG_ERROR, + "Overread slice header by %d bits\n", -get_bits_left(gb)); + return AVERROR_INVALIDDATA; + } + s->HEVClc->first_qp_group = !s->sh.dependent_slice_segment_flag; if (!s->pps->cu_qp_delta_enabled_flag) @@ -2484,7 +2490,7 @@ static int hls_nal_unit(HEVCContext *s) return AVERROR_INVALIDDATA; av_log(s->avctx, AV_LOG_DEBUG, - "nal_unit_type: %d, nuh_layer_id: %dtemporal_id: %d\n", + "nal_unit_type: %d, nuh_layer_id: %d, temporal_id: %d\n", s->nal_unit_type, nuh_layer_id, s->temporal_id); return nuh_layer_id == 0;