1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/hevc/hevcdec: ensure a bit was read when checking for alignment_bit_equal_to_one

Prevents printing bogus errors about the value being 0, when in fact we
overread the available slice buffer.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-05-02 16:26:04 -03:00
parent 62f7b43b53
commit d34c738435

View File

@ -1154,7 +1154,7 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext
} }
ret = get_bits1(gb); ret = get_bits1(gb);
if (!ret) { if (!ret && get_bits_left(gb) >= 0) {
av_log(s->avctx, AV_LOG_ERROR, "alignment_bit_equal_to_one=0\n"); av_log(s->avctx, AV_LOG_ERROR, "alignment_bit_equal_to_one=0\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }