[FFmpeg-devel] [PATCH 05/13] lavfi/vf_psnr: check fclose return value

Ganesh Ajjanagadde gajjanagadde at gmail.com
Tue Jan 12 14:06:32 CET 2016


On Tue, Jan 12, 2016 at 3:32 AM, Paul B Mahol <onemda at gmail.com> wrote:
> On 1/12/16, Ganesh Ajjanagadde <gajjanagadde at gmail.com> wrote:
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> ---
>>  libavfilter/vf_psnr.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
>> index bce5c51..b6e7f06 100644
>> --- a/libavfilter/vf_psnr.c
>> +++ b/libavfilter/vf_psnr.c
>> @@ -339,7 +339,10 @@ static av_cold void uninit(AVFilterContext *ctx)
>>      ff_dualinput_uninit(&s->dinput);
>>
>>      if (s->stats_file && s->stats_file != stdout)
>> -        fclose(s->stats_file);
>> +        if (fclose(s->stats_file))
>> +            av_log(NULL, AV_LOG_ERROR,
>> +                   "Unable to close file '%s', loss of information
>> possible: %s\n",
>> +                   s->stats_file_str, av_err2str(AVERROR(errno)));
>>  }
>>
>>  static const AVFilterPad psnr_inputs[] = {
>> --
>> 2.7.0
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
> Please use context for av_log here and in other patches if available.

Forgot about this in some of the patches. Noted, thanks.


More information about the ffmpeg-devel mailing list