[FFmpeg-devel] [PATCH] ffmpeg: don't overwrite av_bsf_receive_packet return value before checking it

James Almer jamrial at gmail.com
Fri Nov 4 05:21:16 EET 2016


Signed-off-by: James Almer <jamrial at gmail.com>
---
 ffmpeg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 9809876..8c672cd 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -805,9 +805,11 @@ static void output_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
              * TODO/FIXME - Make aac_adtstoasc use new packet side data instead of changing
              * par_out->extradata and adapt muxers accordingly to get rid of this. */
             if (!(ost->bsf_extradata_updated[idx - 1] & 1)) {
-                ret = avcodec_parameters_copy(ost->st->codecpar, ost->bsf_ctx[idx - 1]->par_out);
-                if (ret < 0)
+                int err = avcodec_parameters_copy(ost->st->codecpar, ost->bsf_ctx[idx - 1]->par_out);
+                if (err < 0) {
+                    ret = err;
                     goto finish;
+                }
                 ost->bsf_extradata_updated[idx - 1] |= 1;
             }
             if (ret == AVERROR(EAGAIN)) {
-- 
2.10.1



More information about the ffmpeg-devel mailing list