[SCM] libav/experimental: Use av_mallocz() to initialize hwaccel_data_private.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:41:12 UTC 2013


The following commit has been merged in the experimental branch:
commit cd823ff950cf81d54965eceedb64569fee79ab36
Author: Gwenole Beauchesne <gbeauchesne at splitted-desktop.com>
Date:   Wed Mar 11 08:25:00 2009 +0000

    Use av_mallocz() to initialize hwaccel_data_private.
    
    Originally committed as revision 17942 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8fdc9d1..1042438 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2467,9 +2467,9 @@ typedef struct AVHWAccel {
     /**
      * Size of HW accelerator private data.
      *
-     * Private data is allocated with av_malloc() before
-     * AVCodecContext::get_buffer() and deallocated after
-     * AVCodecContext::release_buffer().
+     * Private data is allocated with av_mallocz() before
+     * AVCodecContext.get_buffer() and deallocated after
+     * AVCodecContext.release_buffer().
      */
     int priv_data_size;
 } AVHWAccel;
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 9602604..703992d 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -183,7 +183,7 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
     if (s->avctx->hwaccel) {
         assert(!pic->hwaccel_data_private);
         if (s->avctx->hwaccel->priv_data_size) {
-            pic->hwaccel_data_private = av_malloc(s->avctx->hwaccel->priv_data_size);
+            pic->hwaccel_data_private = av_mallocz(s->avctx->hwaccel->priv_data_size);
             if (!pic->hwaccel_data_private) {
                 av_log(s->avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n");
                 return -1;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list