]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_palettegen.c
Merge commit 'f7cc6627c01ad3f5bc6ea2d0e6f8adb3a0b490d7'
[ffmpeg] / libavfilter / vf_palettegen.c
index 1aa5e19e04d58ab7823e4bc6a5757b61608a02bf..323fa53688d3b8ccb0e5de3e14e502fc877eb390 100644 (file)
@@ -52,7 +52,7 @@ enum {
     NB_STATS_MODE
 };
 
-#define NBITS 4
+#define NBITS 5
 #define HIST_SIZE (1<<(3*NBITS))
 
 typedef struct {
@@ -90,8 +90,11 @@ static int query_formats(AVFilterContext *ctx)
     static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE};
     AVFilterFormats *in  = ff_make_format_list(in_fmts);
     AVFilterFormats *out = ff_make_format_list(out_fmts);
-    if (!in || !out)
+    if (!in || !out) {
+        av_freep(&in);
+        av_freep(&out);
         return AVERROR(ENOMEM);
+    }
     ff_formats_ref(in,  &ctx->inputs[0]->out_formats);
     ff_formats_ref(out, &ctx->outputs[0]->in_formats);
     return 0;