On 9/18/11 7:02 AM, Anton Khirnov wrote:
From: Michael Niedermayer<[email protected]>

Signed-off-by: Anton Khirnov<[email protected]>
---
  libavfilter/defaults.c |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
index b891ab1..5532953 100644
--- a/libavfilter/defaults.c
+++ b/libavfilter/defaults.c
@@ -37,12 +37,12 @@ void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
   * alloc&  free cycle currently implemented. */
  AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int 
perms, int w, int h)
  {
-    int linesize[4];
+    int linesize[4], ret;
      uint8_t *data[4];
      AVFilterBufferRef *picref = NULL;

      // +2 is needed for swscaler, +16 to be SIMD-friendly
-    if (av_image_alloc(data, linesize, w, h, link->format, 16)<  0)
+    if ((ret = av_image_alloc(data, linesize, w, h, link->format, 16))<  0)
          return NULL;

      picref = avfilter_get_video_buffer_ref_from_arrays(data, linesize,
@@ -51,6 +51,7 @@ AVFilterBufferRef 
*avfilter_default_get_video_buffer(AVFilterLink *link, int per
          av_free(data[0]);
          return NULL;
      }
+    memset(data[0], 128, ret);

      return picref;
  }

I'd change the commit message or extend it to explain why it should be set to 128. While at it a space between ) and < might be added.

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to