Message ID | 20191209222604.28920-7-andreas.rheinhardt@gmail.com |
---|---|
State | Accepted |
Headers | show |
On Mon, Dec 09, 2019 at 11:26:04PM +0100, Andreas Rheinhardt wrote: > They are spec-incompliant. > > Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> > --- > libavcodec/cbs_mpeg2.c | 3 +++ > 1 file changed, 3 insertions(+) will apply thx [...]
diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c index e42c602476..b57551c92a 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;
They are spec-incompliant. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> --- libavcodec/cbs_mpeg2.c | 3 +++ 1 file changed, 3 insertions(+)