[MPlayer-advusers] [BUG] mencoder floating point exception with -of lavf

Guillaume POIRIER poirierg at gmail.com
Sat Nov 5 10:24:53 CET 2005


Hi,

On 11/5/05, Corey Hickey <bugfood-ml at fatooh.org> wrote:
> I'm running into a SIGFPE when I try to use the libavformat muxer. The
> location of the error is easy to see -- av_frac_add tries to divide by
> zero when the pts AVFrac is {0, 0, 0}. How to fix the problem, though,
> is beyond me.

I ran into the problem several weeks ago, and this problem has been a
bit investigated in this thread:

Date: Oct 4, 2005 5:11 PM
Subject: Re: [Ffmpeg-devel] [Ffmpeg-devel-old] Division by 0 in av_frac_add()

and a patch that doesn't really fix the problem but resolves the crash
as been written by Nico Sabi.

Here's the patch:

Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.167
diff -u -r1.167 utils.c
--- utils.c     18 Sep 2005 14:45:17 -0000      1.167
+++ utils.c     4 Oct 2005 15:54:30 -0000
@@ -3140,6 +3140,9 @@

     num = f->num + incr;
     den = f->den;
+    if (!den) { // den should never be negative, but if it is, return
in order not to divide by zero
+        return;
+    }
     if (num < 0) {
         f->val += num / den;
         num = num % den;

Cheers,

Guillaume
--
Reading doesn't hurt, really!
 -- Dominik 'Rathann' Mierzejewski




More information about the MPlayer-advusers mailing list