[FFmpeg-devel] utils.c patch to avoid divide by zero

Ronald S. Bultje rsbultje
Wed Aug 26 21:18:11 CEST 2009


Hi Frank,

On Wed, Aug 26, 2009 at 3:13 PM, Frank Barchard<fbarchard at google.com> wrote:
> On Wed, Aug 26, 2009 at 6:51 AM, Ronald S. Bultje<rsbultje at gmail.com> wrote:
>> If this is the same as what I think it is, then it's triggered by
>> RTSP. I've emailed Luca & Luca about fixing it in rtsp.c (another bug)
>> but we haven't agreed on a solution yet. The bug occurs for any audio
>> stream with an unknown payload / codecID.
>
> My crash wasn't RTSP; It came from Ogg Vorbis (audio) decoder. ?Which
> is fixed now.

I got that. RTSP is just another case that triggers the same bug.

I think you should add an abort() on zero-divides (or a printf() if
you want to play nice), rather than making it "just work", and fix the
cases where the function is handed a zero. Dividing by zero is a bug,
not a feature.

Ronald



More information about the ffmpeg-devel mailing list