]> git.sesse.net Git - ffmpeg/commit
avcodec/ac3enc_template: Don't free uninitialized pointers on error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 14 Sep 2020 00:59:51 +0000 (02:59 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 18 Sep 2020 00:52:04 +0000 (02:52 +0200)
commitae36fad624307dcd1bbe0c954a017293a1ce34d3
treeba1fa0bdf837565d590980d969f91a6017806806
parent6d801894865e3a5b2ae661761ecf21f82d7bda9d
avcodec/ac3enc_template: Don't free uninitialized pointers on error

The ac3 encoders (fixed- and floating-point AC-3 as well as the EAC-3
encoder) all allocate an array whose elements are pointers to other
buffers. The array is not zeroed initially so that if an allocation of
one of the subbuffers fails, the other pointers are uninitialized.
This causes problems when cleaning, so zero the array initially.

(Only the fixed-point AC-3 encoder was affected by this, because
the other two don't clean up at all in case of errors during init.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/ac3enc_template.c