avcodec/avpacket: Use av_free_packet() in error cleanups

This prevents memleaks on errors
reproduceable with fate when error pathes are forced

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/35/head
Michael Niedermayer 11 years ago
parent 5c504e4df7
commit 6e1b1a27a4
  1. 4
      libavcodec/avpacket.c

@ -215,7 +215,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return 0;
failed_alloc:
av_destruct_packet(pkt);
av_free_packet(pkt);
return AVERROR(ENOMEM);
}
@ -237,7 +237,7 @@ int av_copy_packet_side_data(AVPacket *pkt, AVPacket *src)
return 0;
failed_alloc:
av_destruct_packet(pkt);
av_free_packet(pkt);
return AVERROR(ENOMEM);
}

Loading…
Cancel
Save