Merge commit 'a5d42043093a39636a1f4021a37dd9c612479f6f'

* commit 'a5d42043093a39636a1f4021a37dd9c612479f6f':
  avformat: Always return ref-counted AVPacket

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
Hendrik Leppkes
2015-10-27 14:12:27 +01:00
3 changed files with 8 additions and 5 deletions

View File

@@ -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,