[FFmpeg-devel] [PATCH] swscale crash fix from Debian
Måns Rullgård
mans
Thu May 29 09:14:53 CEST 2008
Diego Biurrun <diego at biurrun.de> writes:
> Here is a patch from the Debian patchset for FFmpeg across which I just
> stumbled. I have no further details apart from what is in the patch,
> but since it is so small I suppose it should be easy to review.
>
> Diego
>
> if sws_scale is given an invalid context (e.g. a null pointer), the
> function will crash because of a null pointer dereference. Add a check
> for that here.
>
> Reference:
> http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/2008-March/000965.html
>
> Index: libswscale/swscale.c
> ===================================================================
> --- libswscale/swscale.c 2008-03-28 12:45:33.000000000 +0100
> +++ libswscale/swscale.c 2008-03-28 16:25:24.000000000 +0100
> @@ -2529,6 +2529,11 @@
> int i;
> uint8_t* src2[4]= {src[0], src[1], src[2]};
> uint32_t pal[256];
> +
> + if (!c) {
> + av_log(c, AV_LOG_ERROR, "swScaler: SwsContext invalid\n");
> + return 0;
> + }
Which function is this? IMHO, users can blame themselves if they pass
null pointers into functions not expecting one. Besides, there are
billions of other, equally invalid values a buggy app could pass, so
there's little sense in checking for just one of them.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list