/* 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
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;