[FFmpeg-devel] [PATCH 2/7] ffprobe: check av_frame_alloc() failure.

Stefano Sabatini stefasab at gmail.com
Sun Dec 29 12:51:35 CET 2013


On date Sunday 2013-12-29 11:11:43 +0100, Nicolas George encoded:
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  ffprobe.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index 0374d37..ef3bcc6 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -1887,6 +1887,10 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
>      }
>  
>      frame = av_frame_alloc();
> +    if (!frame) {
> +        ret = AVERROR(ENOMEM);
> +        goto end;
> +    }
>      while (!av_read_frame(fmt_ctx, &pkt)) {
>          if (selected_streams[pkt.stream_index]) {
>              AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;

LGTM, thanks.
-- 
FFmpeg = Fundamentalist and Frightening Most Programmable Evangelical Geek


More information about the ffmpeg-devel mailing list