CC: [email protected]
Signed-off-by: Derek Buitenhuis <[email protected]>
---
 libavcodec/ituh263dec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 25dd4d9..96aa533 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -866,6 +866,11 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
     int format, width, height, i;
     uint32_t startcode;
 
+    if (get_bits_left(&s->gb) < 22 - 8) {
+        av_log(s->avctx, AV_LOG_ERROR, "Not enough bits to decode header.\n");
+        return -1;
+    }
+
     align_get_bits(&s->gb);
 
     startcode= get_bits(&s->gb, 22-8);
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to