[FFmpeg-devel] [PATCH] Adding av_abort() : adding custom handlers for abort().

Julien Vary jvary at genetec.com
Wed Jul 27 21:13:35 EEST 2022


>> abort() should generally not be in a reachable part of the code - not 
>> inside any of the libraries anyway, ffmpeg.c is a different topic.
>> If it is reachable with any input files, and not just present to shut 
>> up compilers, this is a bug and should be addressed to return an error 
>> instead.
>>
>> Therefore, we should address those cases, and just leave abort as-is 
>> otherwise. Nevermind that av_abort would need to be a public function, 
>> which sounds like a really bad idea.
>
>IMHO abort() calls should all be converted to av_assert0(0). Or is there a use case for using abort() directly? I don't think so.
>
>Or maybe we could add av_abort() as an alias to av_assert0(0), which eventually just calls abort()...

I agree that if the goal is to bail-out on 'should-not-be-reachable' code, something that alias av_assert0(0) seems a great idea.
Shall we then give a more descriptive name than plain "av_abort()" for those situations?

Nicolas George & Hendrik Leppkes ? Your thoughts ?


More information about the ffmpeg-devel mailing list