[FFmpeg-devel] [PATCH]lavf/movenc: Fix a compilation warning

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Aug 23 22:05:37 EEST 2016


Hi!

Attached patch fixes a warning here, am I misunderstanding the code?

Please comment, Carl Eugen
-------------- next part --------------
From 3b562e7fada0474dee1fcab17c7458344c2c5036 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
Date: Tue, 23 Aug 2016 21:02:57 +0200
Subject: [PATCH] lavf/movenc: Add a missing assignment if memory allocation
 fails.

Fixes a warning:
libavformat/movenc.c:5947:17: warning: statement with no effect [-Wunused-value]
---
 libavformat/movenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 1f55333..9bf3a04 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5944,7 +5944,7 @@ static int mov_write_trailer(AVFormatContext *s)
             track->vos_len  = par->extradata_size;
             track->vos_data = av_malloc(track->vos_len);
             if (!track->vos_data) {
-                AVERROR(ENOMEM);
+                res = AVERROR(ENOMEM);
                 goto error;
             }
             memcpy(track->vos_data, par->extradata, track->vos_len);
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list