[Ffmpeg-devel] MPEG2 seeking broken

Steve Lhomme steve.lhomme
Thu Apr 20 08:12:27 CEST 2006


Michael Niedermayer wrote:
>>>>>>> +    assert(ref_picture != NULL);
>>>>>>> +    if (ref_picture == NULL) {
>>>>>> is not acceptable
>>>>> What's the policy? No asserts?
>>>>
>>>> I believe I can answer this one:
>>>>
>>>> You asserted that ref_picture != NULL and them creates some condition to
>>>> execute in case ref_picture is NULL. It won't ever be executed.
>>> One is designed to catch the error during debugging, the other is
>>> designed to not crash in "release" builds. Crashing a user software when
>>> you know there's a potential problem is gross.
>> Yeah, I thought that could be so. This is the risk of answering
>> without seeing the whole code.
>>
>> Let's hear from Michael.
> 
> an assertion failure is a bug and should be fixed, i will not commit
> code which is per design buggy (expects the assert to fail)
> 
> assert(x) means that the programmer belives x is true (and that some part of
> the code depends upon this assumtation), its not for anything else, and here
> its clear the programmer knows that x is not always true

$ pwd
/C/Perso/Programmes/ffmpeg.cvs
$ find . -name "*.c" -exec grep -w assert {} \;|wc -l
     512

> the code submitted is nothing else as
> 
> if(ref_picture == NULL){
> #ifdef DEBUG
>     abort();
> #endif
>     ...
> }

I guess it's up to the MPEG2 maintainer to fix that bug the FFMPEG way then.

Steve





More information about the ffmpeg-devel mailing list