]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/interplayvideo.c
fix ac3 and dts detection (patch by Joakim Plate <joakim.plate at ecce.se>)
[ffmpeg] / libavcodec / interplayvideo.c
index f354b734c33ce62b1fa488b18065e696081b7d2e..f4add08c0dd6f16c8caac09342db264b6b12106c 100644 (file)
@@ -47,7 +47,7 @@
 /* debugging support */
 #define DEBUG_INTERPLAY 0
 #if DEBUG_INTERPLAY
-#define debug_interplay printf
+#define debug_interplay(x,...) av_log(NULL, AV_LOG_DEBUG, x, __VA_ARGS__)
 #else
 static inline void debug_interplay(const char *format, ...) { }
 #endif
@@ -900,6 +900,11 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
     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;