On Mon, Mar 09, 2015 at 12:03:11AM +0100, Andreas Cadhalpun wrote:
> Hi,
> 
> attached patch fixes potential crashes.
> 
> Best regards,
> Andreas

>  ffmdec.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> fa490a9bc11b6c8748f707fabf79d28de237ef30  
> 0002-ffmdec-check-codec-pointer-before-use.patch
> From 011296153f6e0e0112803474c41c4afa840a1e6d Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
> Date: Sun, 8 Mar 2015 23:07:25 +0100
> Subject: [PATCH 2/8] ffmdec: check codec pointer before use
> 
> It is only set in the COMM case of the switch statement, but that is not
> guaranteed to come before the others.
> 
> Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
> ---
>  libavformat/ffmdec.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
> index 280a24c..af37e74 100644
> --- a/libavformat/ffmdec.c
> +++ b/libavformat/ffmdec.c
> @@ -259,7 +259,7 @@ static int ffm2_read_header(AVFormatContext *s)
>      FFMContext *ffm = s->priv_data;
>      AVStream *st;
>      AVIOContext *pb = s->pb;
> -    AVCodecContext *codec;
> +    AVCodecContext *codec = NULL;
>      int ret;
>      int f_main = 0, f_cprv = -1, f_stvi = -1, f_stau = -1;
>      AVCodec *enc;

ok

arent the other checks redundant though ?
as the "counters" would be -1 if codec hasnt been allocated

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu

Attachment: signature.asc
Description: Digital signature

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

Reply via email to