Commit ce920f47 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

avcodec/cbs_mpeg2: Treat slices without data as invalid

They are spec-incompliant.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent b1aecad9
...@@ -245,6 +245,9 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx, ...@@ -245,6 +245,9 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
if (err < 0) if (err < 0)
return err; return err;
if (!get_bits_left(&gbc))
return AVERROR_INVALIDDATA;
pos = get_bits_count(&gbc); pos = get_bits_count(&gbc);
len = unit->data_size; len = unit->data_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment