# HG changeset patch # User gb # Date 1236759900 0 # Node ID 3a54ad453dbf91a1941359482b1e0be8cae3ea27 # Parent 678152bdb3a167f77623c6ed9e990ad3b0dc7ea1 Use av_mallocz() to initialize hwaccel_data_private. diff -r 678152bdb3a1 -r 3a54ad453dbf avcodec.h --- a/avcodec.h Tue Mar 10 17:38:16 2009 +0000 +++ b/avcodec.h Wed Mar 11 08:25:00 2009 +0000 @@ -2467,9 +2467,9 @@ /** * 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 -r 678152bdb3a1 -r 3a54ad453dbf mpegvideo.c --- a/mpegvideo.c Tue Mar 10 17:38:16 2009 +0000 +++ b/mpegvideo.c Wed Mar 11 08:25:00 2009 +0000 @@ -183,7 +183,7 @@ 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;