1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-29 05:57:37 +02:00

cbs: Always check for bitstream end before reading

This commit is contained in:
Mark Thompson
2017-09-12 22:11:41 +01:00
parent b05128f3c9
commit 44cde38c8a
3 changed files with 69 additions and 64 deletions

View File

@@ -58,8 +58,9 @@
CHECK(ff_cbs_read_unsigned(ctx, rw, 1, "marker_bit", &one, 1, 1)); \
} while (0)
#define nextbits(width, compare, var) (var = bitstream_peek(rw, width), \
var == (compare))
#define nextbits(width, compare, var) \
(bitstream_bits_left(rw) >= width && \
(var = bitstream_peek(rw, width)) == (compare))
#include "cbs_mpeg2_syntax_template.c"