#1064 closed defect (fixed)
Div/0 integer exception cased in aiffdec.c for A-Law AIFFs
Reported by: | Dmitry | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | aif |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Hi,
Divizion by 0 integer exception is raised in aiffdec.c, line 163:
codec->bit_rate = codec->sample_rate * (codec->block_align << 3) / aiff->block_duration;
if AIFF file is in A-Law format, or any format which is not processed by 'case' starting at line 120.
It is possible to fix it by adding:
aiff->block_duration = 1;
inside 'default' of this 'case'.
So the code will look like this:
switch (codec->codec_id) { case CODEC_ID_PCM_S16BE: codec->codec_id = aiff_codec_get_id(codec->bits_per_coded_sample); codec->bits_per_coded_sample = av_get_bits_per_sample(codec->codec_id); aiff->block_duration = 1; break; case CODEC_ID_ADPCM_IMA_QT: codec->block_align = 34*codec->channels; aiff->block_duration = 64; break; case CODEC_ID_MACE3: codec->block_align = 2*codec->channels; aiff->block_duration = 6; break; case CODEC_ID_MACE6: codec->block_align = 1*codec->channels; aiff->block_duration = 6; break; case CODEC_ID_GSM: codec->block_align = 33; aiff->block_duration = 160; break; case CODEC_ID_QCELP: codec->block_align = 35; aiff->block_duration = 160; break; default: aiff->block_duration = 1; //!< avoid Div/0 break; }
Change History (4)
comment:1 by , 13 years ago
Component: | FFmpeg → avformat |
---|---|
Keywords: | aiff added |
Priority: | critical → important |
Reproduced by developer: | set |
Status: | new → open |
comment:2 by , 13 years ago
Please consider sending patches to ffmpeg-devel, they get more attention there.
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed by Thomas Tomas Härdin with a mostly identical patch.
comment:4 by , 12 years ago
Keywords: | aif added; aiff removed |
---|
Note:
See TracTickets
for help on using tickets.