Commit bae8844e authored by James Almer's avatar James Almer

avformat/utils: unref packet on AVInputFormat.read_packet() failure

Demuxers may have allocated a packet before encountering an error and aborting.

Fixes ticket #8150
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 66d5e43b
......@@ -854,6 +854,8 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
av_init_packet(pkt);
ret = s->iformat->read_packet(s, pkt);
if (ret < 0) {
av_packet_unref(pkt);
/* Some demuxers return FFERROR_REDO when they consume
data and discard it (ignored streams, junk, extradata).
We must re-call the demuxer to get the real packet. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment