diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-27 14:12:27 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-27 14:12:27 +0100 |
commit | 856b19d5935b544e96156f8e75e23b28c0a9f318 (patch) | |
tree | c6e8461815cff046a92ba95d870037e254800717 /libavformat/utils.c | |
parent | fe3c22e0c00b5129853f4c02d6fbee2c09846666 (diff) | |
parent | a5d42043093a39636a1f4021a37dd9c612479f6f (diff) | |
download | ffmpeg-streaming-856b19d5935b544e96156f8e75e23b28c0a9f318.zip ffmpeg-streaming-856b19d5935b544e96156f8e75e23b28c0a9f318.tar.gz |
Merge commit 'a5d42043093a39636a1f4021a37dd9c612479f6f'
* commit 'a5d42043093a39636a1f4021a37dd9c612479f6f':
avformat: Always return ref-counted AVPacket
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 689473e..3b6530f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -683,6 +683,14 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) continue; } + if (!pkt->buf) { + AVPacket tmp = { 0 }; + ret = av_packet_ref(&tmp, pkt); + if (ret < 0) + return ret; + *pkt = tmp; + } + if ((s->flags & AVFMT_FLAG_DISCARD_CORRUPT) && (pkt->flags & AV_PKT_FLAG_CORRUPT)) { av_log(s, AV_LOG_WARNING, |