From f235359b2b1175585df757e6b60fabac29b8aa22 Mon Sep 17 00:00:00 2001 From: James Almer Date: Mon, 26 Feb 2018 00:18:53 -0300 Subject: [PATCH] avformat/utils: don't overwrite the return value of read_packet() This only affected demuxers that didn't return reference counted packets. Reviewed-by: Michael Niedermayer Signed-off-by: James Almer --- libavformat/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 2c2ea876b6..72531d4185 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -869,9 +869,9 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) if (!pkt->buf) { AVPacket tmp = { 0 }; - ret = av_packet_ref(&tmp, pkt); - if (ret < 0) - return ret; + err = av_packet_ref(&tmp, pkt); + if (err < 0) + return err; *pkt = tmp; }