History

lavc: fix 10l oversight in realloc of avcodec_encode_video2.

Packets are not guranteed to be allocated by av_malloc().

Michael Niedermayer committed 14 years ago

Commit a77c8ad1 parent d7bce4a1 file · +1 −1Browse files

Unified · Split

libavcodec/utils.c+1−1
@@ -1219,7 +1219,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, · 1218 unmodified lines
1219 avpkt->size = 0;1219 avpkt->size = 0;
1220 else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))1220 else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
1221 avpkt->pts = avpkt->dts = frame->pts;1221 avpkt->pts = avpkt->dts = frame->pts;
1222 if (avpkt->data) {1222 if (avpkt->data && avpkt->destruct == av_destruct_packet) {
1223 new_data = av_realloc(avpkt->data,1223 new_data = av_realloc(avpkt->data,
1224 avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);1224 avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
1225 if (new_data)1225 if (new_data)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t