changeset 1770:cd36e37fb879 libavcodec

handle invalid buffer sizes
author melanson
date Sat, 31 Jan 2004 18:17:38 +0000
parents 1514fd5d434b
children 8488bab5efa2
files interplayvideo.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/interplayvideo.c	Sat Jan 31 17:57:57 2004 +0000
+++ b/interplayvideo.c	Sat Jan 31 18:17:38 2004 +0000
@@ -900,6 +900,11 @@
     IpvideoContext *s = avctx->priv_data;
     AVPaletteControl *palette_control = avctx->palctrl;
 
+    /* compressed buffer needs to be large enough to at least hold an entire
+     * decoding map */
+    if (buf_size < s->decoding_map_size)
+        return buf_size;
+
     s->decoding_map = buf;
     s->buf = buf + s->decoding_map_size;
     s->size = buf_size - s->decoding_map_size;