[FFmpeg-devel] [PATCH 1/3] avformat/concatdec: Check file variable before dereferencing

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Sep 3 17:09:26 CEST 2015


On Thu, Sep 3, 2015 at 6:03 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> From: Michael Niedermayer <michael at niedermayer.cc>
>
> Fixes CID1322328
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavformat/concatdec.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> index 969b001..88b6dbe 100644
> --- a/libavformat/concatdec.c
> +++ b/libavformat/concatdec.c
> @@ -394,6 +394,11 @@ static int concat_read_header(AVFormatContext *avf)
>                  av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata required\n", line);
>                  FAIL(AVERROR_INVALIDDATA);
>              }
> +            if (!file) {
> +                av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
> +                       line, keyword);
> +                FAIL(AVERROR_INVALIDDATA);
> +            }
>              if ((ret = av_dict_parse_string(&file->metadata, metadata, "=", "", 0)) < 0) {
>                  av_log(avf, AV_LOG_ERROR, "Line %d: failed to parse metadata string\n", line);
>                  av_freep(&metadata);
> --
> 1.7.9.5

LGTM

>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list