History

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.

James Almer committed 1 year ago

Commit d34c7381 parent 62f7b431 file · +1 −1Browse files

Unified · Split

libavcodec/hevc/hevcdec.c+1−1
@@ -1154,7 +1154,7 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext · 1153 unmodified lines
11541154 }
11551155
11561156 ret = get_bits1(gb);
1157− if (!ret) {
1157+ if (!ret && get_bits_left(gb) >= 0) {
11581158 av_log(s->avctx, AV_LOG_ERROR, "alignment_bit_equal_to_one=0\n");
11591159 return AVERROR_INVALIDDATA;
11601160 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t