add missing FF_API_DESTRUCT_PACKET guards

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun
2015-08-08 10:41:30 +02:00
parent 5f1c37aefb
commit c363843a53
4 changed files with 22 additions and 2 deletions

View File

@ -693,7 +693,13 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
if(a == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
FF_DISABLE_DEPRECATION_WARNINGS
if(a == 0 && new_pkt.data != pkt->data
#if FF_API_DESTRUCT_PACKET
&& new_pkt.destruct
#endif
) {
FF_ENABLE_DEPRECATION_WARNINGS
uint8_t *t = av_malloc(new_pkt.size + AV_INPUT_BUFFER_PADDING_SIZE); //the new should be a subset of the old so cannot overflow
if(t) {
memcpy(t, new_pkt.data, new_pkt.size);