mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
Use av_mallocz() to initialize hwaccel_data_private.
Originally committed as revision 17942 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
27ad7d3a96
commit
cd823ff950
@ -2467,9 +2467,9 @@ typedef struct AVHWAccel {
|
|||||||
/**
|
/**
|
||||||
* Size of HW accelerator private data.
|
* Size of HW accelerator private data.
|
||||||
*
|
*
|
||||||
* Private data is allocated with av_malloc() before
|
* Private data is allocated with av_mallocz() before
|
||||||
* AVCodecContext::get_buffer() and deallocated after
|
* AVCodecContext.get_buffer() and deallocated after
|
||||||
* AVCodecContext::release_buffer().
|
* AVCodecContext.release_buffer().
|
||||||
*/
|
*/
|
||||||
int priv_data_size;
|
int priv_data_size;
|
||||||
} AVHWAccel;
|
} AVHWAccel;
|
||||||
|
@ -183,7 +183,7 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
|
|||||||
if (s->avctx->hwaccel) {
|
if (s->avctx->hwaccel) {
|
||||||
assert(!pic->hwaccel_data_private);
|
assert(!pic->hwaccel_data_private);
|
||||||
if (s->avctx->hwaccel->priv_data_size) {
|
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) {
|
if (!pic->hwaccel_data_private) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n");
|
av_log(s->avctx, AV_LOG_ERROR, "alloc_frame_buffer() failed (hwaccel private data allocation)\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user