---
 libavcodec/motionpixels.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index d054e00..b35a776 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -71,6 +71,11 @@ static void mp_read_changes_map(MotionPixelsContext *mp, 
GetBitContext *gb, int
     uint16_t *pixels;
     int offset, w, h, color = 0, x, y, i;
 
+    if (count * (mp->offset_bits_len + bits_len * 2 + !!read_color * 15) > 
get_bits_left(gb)) {
+        av_log(mp->avctx, AV_LOG_ERROR, "Not enough bits left to read\n");
+        return;
+    }
+
     while (count--) {
         offset = get_bits_long(gb, mp->offset_bits_len);
         w      = get_bits(gb, bits_len) + 1;
-- 
1.7.5.4

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

Reply via email to