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

Michael Niedermayer michael at niedermayer.cc
Tue Aug 23 23:30:19 EEST 2016


On Tue, Aug 23, 2016 at 09:05:37PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes a warning here, am I misunderstanding the code?
> 
> Please comment, Carl Eugen

>  movenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> b1ebc046114fef9cb5d3545a5d0bb2207859c6fe  0001-lavf-movenc-Add-a-missing-assignment-if-memory-alloc.patch
> 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;


LGTM
thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160823/9a580390/attachment.sig>


More information about the ffmpeg-devel mailing list