[FFmpeg-devel] [PATCH] check for mod by zero (issue 2502)

Daniel Kang daniel.d.kang
Fri Jan 7 20:47:00 CET 2011

On Fri, Jan 7, 2011 at 11:00 AM, Justin Ruggles <justin.ruggles at gmail.com>wrote:

> On 01/07/2011 09:52 AM, Daniel Kang wrote:
> it seems the codec_id does change.
> voc_get_packet() changes the codec_id based on packet data.  So I think
> a fix needs to go there.
> but maybe pcm.c also needs a check for sample_size != 0 before
> n = avctx->channels * sample_size.
> -Justin

Adding a check (by itself) does not stop the crash, it simply prints an
error. This would give more information though. If the codec_id is
invalid, what should the behavior be? Is this sufficient?

More information about the ffmpeg-devel mailing list