[FFmpeg-devel] [PATCH] aacenc: Segmentation fault when frame contains samples with NaN values.

Anders Rein are at vizrt.com
Fri Mar 7 16:41:19 CET 2014


On 03/07/2014 04:16 PM, Michael Niedermayer wrote:
> On Fri, Mar 07, 2014 at 04:08:25PM +0100, Anders Rein wrote:
>> The ffmpeg executable gave a segmentation fault when transcoding a
>> wmv file to mp4 (h264, aac). The segfault happend in the aac encoder
>> code and was caused by the wma2 decoder returning NaN samples. I
>> tried to find the bug in the wma2 decoder, but eventually gave up. I
>> did however add float clamping and checking for NaN in the aac
>> encoder to make it more robust and avoid segmentation faults.
> How can the NaN sample production be reproduced ?
> I dont think decoders should return NaN samples
Here is a link to the input file (I stripped away most of the file plus 
the video stream for copyright reasons):
https://www.dropbox.com/s/4zzp03yes94mnrl/nan_example.wma

Command line to reproduce the segmentation fault:
ffmpeg -i nan_example.wma -acodec aac -strict -2 out.mp4

While I agree that decoders shouldn't return NaN samples, I also don't 
see any reason to make the aac encoder more robust. An encoder shouldn't 
segfault no matter what data is put into it right?


More information about the ffmpeg-devel mailing list