[Ffmpeg-devel] [PATCH] from DivX, Part 13: NULL callback calls

Måns Rullgård mru
Sat Dec 17 11:36:38 CET 2005


Steve Lhomme <steve.lhomme at free.fr> writes:

> Michael Niedermayer wrote:
>> Hi
>> On Fri, Dec 16, 2005 at 04:03:58PM -1000, Steve Lhomme wrote:
>>
>>>Some tests to avoid calling NULL callbacks.
>>
>>>Index: libavcodec/imgconvert.c
>>>===================================================================
>>>RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/imgconvert.c,v
>>>retrieving revision 1.58
>>>diff -u -r1.58 imgconvert.c
>>>--- libavcodec/imgconvert.c	11 Jul 2005 00:43:21 -0000	1.58
>>>+++ libavcodec/imgconvert.c	17 Dec 2005 01:51:48 -0000
>>>@@ -256,7 +256,7 @@
>>>     int i;         for (i=0; i < PIX_FMT_NB; i++)
>>>-         if (!strcmp(pix_fmt_info[i].name, name))
>>>+         if (pix_fmt_info[i].name && !strcmp(pix_fmt_info[i].name, name))
>> a pixel format with no name is a bug
>
> A crash is a bigger bug IMO. You can't wait for a software to crash to
> solve possible problems. Maybe I just added the test just in case, I
> don't remember that one.

If you paper over errors like that, you'll never find the real bug.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list