vf_hwdownload: allocate the destination frame for the pool size
authorAnton Khirnov <anton@khirnov.net>
Fri, 15 Apr 2016 08:44:02 +0000 (10:44 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 28 Jun 2016 06:32:00 +0000 (08:32 +0200)
The reasoning is the same as for the previous commit.

libavfilter/vf_hwdownload.c

index 4ba465b..42925b8 100644 (file)
@@ -140,7 +140,8 @@ static int hwdownload_filter_frame(AVFilterLink *link, AVFrame *input)
         goto fail;
     }
 
-    output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+    output = ff_get_video_buffer(outlink, ctx->hwframes->width,
+                                 ctx->hwframes->height);
     if (!output) {
         err = AVERROR(ENOMEM);
         goto fail;
@@ -152,6 +153,9 @@ static int hwdownload_filter_frame(AVFilterLink *link, AVFrame *input)
         goto fail;
     }
 
+    output->width  = outlink->w;
+    output->height = outlink->h;
+
     err = av_frame_copy_props(output, input);
     if (err < 0)
         goto fail;