]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xan.c
apedec: return meaningful error codes from ape_decode_init()
[ffmpeg] / libavcodec / xan.c
index 3965617838e80c547d9ea22ae60e26aa9b1038f5..54d6d15da41424316605b11da557d679f90fde8c 100644 (file)
@@ -553,6 +553,11 @@ static int xan_decode_frame(AVCodecContext *avctx,
         }
         buf_size = buf_end - buf;
     }
+    if (s->palettes_count <= 0) {
+        av_log(s->avctx, AV_LOG_ERROR, "No palette found\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if ((ret = avctx->get_buffer(avctx, &s->current_frame))) {
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
         return ret;