On 05/18/2013 06:13 AM, Anton Khirnov wrote: > That is a bug in the decoder then, which should be fixed. It's not really > different from any other bug that would cause a crash. > Many kinds of code can cause a crash if there's a bug there, shall we remove > all > such code?
Usually we do, by fixing the bug. Ideally some assert are completely impossible short of memory corruption, some are possible and thus should be replaced with normal error paths. > That said, I'm not against replacing plain asserts with av_asserts, so people > who prefer random hard to debug crashes over asserts can choose that. I'm against replacing plain asserts with av_asserts, ether they have no sense, thus should be removed like commented out code, or they have sense, thus should be replaced with normal error paths. The only reason you should put asserts is when you refactor code so it gets glaring obvious when you are doing wrong. At the cost of being boring asserts have no place in released code, as you said an assert is a bug and should be threaded accordingly. > But I am against removing asserts on the grounds that 'it might crash if there > is a bug in it'. A lot of code might crash if there is a bug in it. And usually we fix the bugs =) Moving to avassert is just like leaving known issues because of lack of time. lu _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
