]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_signature.c
Merge commit '82989bd98c7f4e87f59af2147b645b8fd8f31c53'
[ffmpeg] / libavfilter / vf_signature.c
index 06b1b910d4d8500ab1d11b143f62fd3f6d430481..f0078ba1a6eb11a2a146f42cfd9e33821a429cd7 100644 (file)
@@ -260,8 +260,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
         if (!elemsignature)
             return AVERROR(ENOMEM);
         sortsignature = av_malloc_array(elemcat->elem_count, sizeof(int64_t));
-        if (!sortsignature)
+        if (!sortsignature) {
+            av_freep(&elemsignature);
             return AVERROR(ENOMEM);
+        }
 
         for (j = 0; j < elemcat->elem_count; j++) {
             blocksum = 0;
@@ -508,6 +510,7 @@ static int binary_export(AVFilterContext *ctx, StreamContext *sc, const char* fi
         char buf[128];
         av_strerror(err, buf, sizeof(buf));
         av_log(ctx, AV_LOG_ERROR, "cannot open file %s: %s\n", filename, buf);
+        av_freep(&buffer);
         return err;
     }
     init_put_bits(&buf, buffer, len);