They are spec-incompliant.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
---
 libavcodec/cbs_mpeg2.c | 3 +++
 1 file changed, 3 insertions(+)

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;
 
-- 
2.20.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to