Opened 12 years ago

Closed 12 years ago

#666 closed defect (fixed)

ffmpeg crashes, when input is /dev/zero

Reported by: Міхаіл Owned by: Michael Niedermayer
Priority: important Component: ffmpeg
Version: 0.8.6 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

It seems bizarre to me, but tovid (a DVD-authoring tool) invokes ffmpeg with input set to /dev/zero in order to obtain a silent audio-file of a certain duration. The actual command line reads:

ffmpeg -f s16le -i /dev/zero -ac 2 -ar 48000 -ab 224k -t 4 -acodec ac3 -y audio.ac3

This must've worked before -- and, likely, continues to work for the tovid developers, but ffmpeg-0.7.7 as well as 0.8.6 crash with a floating-point error (SIGFPE), because of an attempt to divide by zero:

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 8078041c0 (LWP 100795/initial thread)]
0x0000000000408e7c in output_packet (ist=0x807df98a0, ist_index=0, ost_table=0x8078660e0, nb_ostreams=1, pkt=0x7fffffffe100)
    at ffmpeg.c:1600
1600                    ist->next_pts += ((int64_t)AV_TIME_BASE/bps * decoded_data_size) /
(gdb) l
1595                    if (!got_output) {
1596                        /* no audio frame */
1597                        continue;
1598                    }
1599                    decoded_data_buf = (uint8_t *)samples;
1600                    ist->next_pts += ((int64_t)AV_TIME_BASE/bps * decoded_data_size) /
1601                        (ist->st->codec->sample_rate * ist->st->codec->channels);
1602                    break;}
1603                case AVMEDIA_TYPE_VIDEO:
1604                        decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2;
(gdb) p ist->st->codec->sample_rate
$1 = 0

Change History (2)

comment:1 by Carl Eugen Hoyos, 12 years ago

Duplicate of ticket #324, not yet fixed in a release branch.

comment:2 by Carl Eugen Hoyos, 12 years ago

Priority: normalimportant
Reproduced by developer: set
Resolution: fixed
Status: newclosed

This should be finally fixed in current git head, 0.7.8 and 0.8.7.

Note: See TracTickets for help on using tickets.