[Oggvideotools-users] [PATCH] Fix crash in oggResize, ogg video tools 0.8
Status: Beta
Brought to you by:
yornstreamnik
From: Thomas P. <tho...@fr...> - 2009-11-03 19:01:41
|
Hi, When using oggResize from Ogg Video Tools 0.8, I encountered a segmentation fault when using the following command line: oggResize -D48000 input.ogv output.ogv gdb gave me the location of the crash: #0 0x0806f917 in main (argc=4, argv=<value optimized out>) at oggResize.cpp:612 612 double aspectCorrection = (theoraDecoder->getInfo().aspect_numerator*1.0)/(theoraDecoder->getInfo().aspect_denominator*1.0); (gdb) p theoraDecoder $1 = (class TheoraDecoder *) 0x0 After a quick analysis, I understood that the line : double aspectCorrection = (theoraDecoder->getInfo().aspect_numerator*1.0)/(theoraDecoder->getInfo().aspect_denominator*1.0); was incorrect, because it was dereferencing theoraDecoder even if copyTheora is true. Or, theoraDecoder is only initialized if the Theora stream needs to be modified (when copyTheora is false), which isn't the case when using -D48000 (only the audio part needs to be tweaked). Therefore, I've modified oggResize.cpp to make sure that aspectCorrection is only computed is copyTheora is false. The attached patch implements such a fix. I initially wanted to generate the patch against the latest SVN version, but found out that oggResize doesn't exist anymore in SVN (why ?). Thanks, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com |