Commit a77c8ade authored by Michael Niedermayer's avatar Michael Niedermayer

lavc: fix 10l oversight in realloc of avcodec_encode_video2.

Packets are not guranteed to be allocated by av_malloc().
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d7bce4a2
...@@ -1219,7 +1219,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, ...@@ -1219,7 +1219,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
avpkt->size = 0; avpkt->size = 0;
else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
avpkt->pts = avpkt->dts = frame->pts; avpkt->pts = avpkt->dts = frame->pts;
if (avpkt->data) { if (avpkt->data && avpkt->destruct == av_destruct_packet) {
new_data = av_realloc(avpkt->data, new_data = av_realloc(avpkt->data,
avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE); avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (new_data) if (new_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment