[FFmpeg-devel] [PATCH v2] ffmpeg: fix uninitialized return value

Tobias Rapp t.rapp at noa-archive.com
Wed Nov 30 16:26:04 EET 2016


On 22.11.2016 15:34, Tobias Rapp wrote:
> On 22.11.2016 15:06, Michael Niedermayer wrote:
>> On Tue, Nov 22, 2016 at 02:43:57PM +0100, Tobias Rapp wrote:
>>> On 22.11.2016 14:34, Michael Niedermayer wrote:
>>>> On Tue, Nov 22, 2016 at 09:16:26AM +0100, Tobias Rapp wrote:
>>>>> Signed-off-by: Tobias Rapp <t.rapp at noa-archive.com>
>>>>> ---
>>>>> ffmpeg.c | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> do you have a testcase for this ?
>>>
>>> No, I just stumbled over it when reading the code.
>>
>> are you sure that the codepath leaving ret uninitialized is possible ?
>>
>> if not adding a av_assert() may be better
>
> From my quick glance I assumed that ist->nb_filters could be zero and
> the for-loop is not entered. If that should never be the case I agree
> that an added av_assert(ist->nb_filters > 0) would be better.

I added an assert and it is not triggered when running FATE, see 
attached patch.

Regards,
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffmpeg-assert-return-value-is-initialized.patch
Type: text/x-patch
Size: 751 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161130/94bed760/attachment.bin>


More information about the ffmpeg-devel mailing list