From cd823ff950cf81d54965eceedb64569fee79ab36 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 11 Mar 2009 08:25:00 +0000 Subject: [PATCH] Use av_mallocz() to initialize hwaccel_data_private. Originally committed as revision 17942 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/avcodec.h | 6 +++--- libavcodec/mpegvideo.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8fdc9d1322..10424384ea 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 9602604b35..703992d45e 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; -- 2.11.0