[FFmpeg-devel] [PATCH] wav: Add check for 'fmt' tag

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed Jul 18 20:45:31 CEST 2012


On 18/07/2012 2:01 PM, Nicolas George wrote:
> An error is for a situation that can happen due to external circumstances,
> even very unlikely ones: out of memory, corrupted file, etc.
> 
> An assert is for a situation where you are pretty sure something is true,
> and you are absolutely sue it should be true, and you want to rely on it in
> the following code, but since the code that lead there is quite complex, you
> are not 100% sure it will actually be true. If, per chance, there is a bug
> and the assert fail, you will get an accurate error message (whereas calling
> code could just ignore the error), and even a backtrace or a core dump.
> 
> AVERROR_BUG is for intermediate cases.

As I look at the code, it still seems quite possible to craft a file
that would fall through and use st as NULL. If you think this is wrong,
please do tell why. I do not believe this is a case where we should use
an assert.

- Derek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120718/34b52e27/attachment.asc>


More information about the ffmpeg-devel mailing list