diff options
author | Stephen Hutchinson <qyot27@gmail.com> | 2013-12-01 06:03:34 -0500 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-01 13:14:42 +0100 |
commit | 801c18644000ed383c1f60ef3f6a9f131209d2b4 (patch) | |
tree | 858542f12c3f90a706e342be183318192f6fde2f | |
parent | 2ccc6ff03acc3ca31db1aeb828c747d05b5cb6aa (diff) | |
download | ffmpeg-801c18644000ed383c1f60ef3f6a9f131209d2b4.tar.gz |
avisynth: Move to av_new_packet/av_free_packet.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avisynth.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index e35306b6a5..670f9d64d5 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -466,9 +466,11 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, (int64_t)avs->vi->height) * bits) / 8; if (!pkt->size) return AVERROR_UNKNOWN; - pkt->data = av_malloc(pkt->size); - if (!pkt->data) + av_new_packet(pkt, (int)pkt->size); + if (av_new_packet(pkt, (int)pkt->size) < 0) { + av_free(pkt); return AVERROR(ENOMEM); + } frame = avs_library->avs_get_frame(avs->clip, n); error = avs_library->avs_clip_get_error(avs->clip); @@ -606,7 +608,7 @@ static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt) if (avs->error) return AVERROR_UNKNOWN; - pkt->destruct = av_destruct_packet; + av_free_packet(pkt); /* If either stream reaches EOF, try to read the other one before * giving up. */ |