[FFmpeg-devel] Fix for static heap leaks in h263.c

Michael Niedermayer michaelni
Fri Jun 20 19:38:30 CEST 2008

On Fri, Jun 20, 2008 at 09:08:51AM -0400, Art Clarke wrote:
> per early discussion, folks allocating static tables should allocate them on
> the stack, not the heap.
> patch attached.
> For what it's worth, I think the table-sizes I passed in are correct (I
> derived them from looking at the exact heap-allocated size in a debugger),
> but it seems fragile to just have the #s in the INIT_VLC_STATIC call.  If
> there is a way to derive the VLC table size statically from the other
> inputs, please let me know and I'll update the patch.
> To reproduce compile the attached FfmpegLeak.c program, and give it an FLV
> file as input.  Then run through valgrind as follows:
> valgrind --leak-check=full --show-reachable=yes your_program your_input.flv
> you should see 11k leaked before the fix, and 0k leaked after the fix.
> As per Michael's suggestion, I'll hold off on other similar fixes (e.g.
> mpegaudiodec.c:376) until folks have had a chance to review this for general
> correctness.

patch looks ok assuming it works and doesnt print any error messages

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080620/eca792ee/attachment.pgp>

More information about the ffmpeg-devel mailing list