diff options
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cbs_mpeg2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c index 13d871cc89..0e5d08ecbf 100644 --- a/libavcodec/cbs_mpeg2.c +++ b/libavcodec/cbs_mpeg2.c @@ -245,6 +245,9 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx, if (err < 0) return err; + if (!get_bits_left(&gbc)) + return AVERROR_INVALIDDATA; + pos = get_bits_count(&gbc); len = unit->data_size; |