[FFmpeg-devel] [PATCH 1/3] ffmpeg_opt: get_preset_file_2(): fix avio_open2() return code check

Michael Niedermayer michaelni at gmx.at
Mon Feb 24 02:52:12 CET 2014


On Sat, Feb 22, 2014 at 01:50:37PM -0800, Timothy Gu wrote:
> avio_open2() only return < 0 when error.
> 
> Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
> ---
>  ffmpeg_opt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index 5db961a..ac48d59 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -984,7 +984,7 @@ static int get_preset_file_2(const char *preset_name, const char *codec_name, AV
>                              AVCONV_DATADIR,
>                              };
>  
> -    for (i = 0; i < FF_ARRAY_ELEMS(base) && ret; i++) {
> +    for (i = 0; i < FF_ARRAY_ELEMS(base) && ret < 0; i++) {

ret is 1 initially so this would break the code

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140224/d88c5eeb/attachment.asc>


More information about the ffmpeg-devel mailing list