Opened 13 years ago

Closed 13 years ago

#124 closed defect (fixed)

Memleak on image size change

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: avfilter
Version: git Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

The sample from ticket #64 now causes a memleak

$ valgrind ffmpeg_g -i all_filese_together.264 -s 640x480 -f null -
==14176== Memcheck, a memory error detector
==14176== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==14176== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==14176== Command: ffmpeg_g -i all_filese_together.264 -s 640x480 -f null -
==14176==
ffmpeg version git-N-29391-gd84f191, Copyright (c) 2000-2011 the FFmpeg developers
  built on Apr 26 2011 20:33:16 with gcc 4.5.2
  configuration: --cc='/usr/local/gcc-4.5.2/bin/gcc -m32' --enable-gpl
  libavutil    51.  0. 0 / 51.  0. 0
  libavcodec   53.  1. 0 / 53.  1. 0
  libavformat  53.  0. 3 / 53.  0. 3
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  0. 0 /  2.  0. 0
  libswscale    0. 13. 0 /  0. 13. 0
==14176== Conditional jump or move depends on uninitialised value(s)
==14176==    at 0x827FA4C: ff_h264_find_frame_end.clone.3 (h264_parser.c:56)
==14176==
[h264 @ 0x7c226a0] missing picture in access unit
[h264 @ 0x7c0fdc0] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (50/2)
Input #0, h264, from 'all_filese_together.264':
  Duration: N/A, bitrate: N/A
    Stream #0.0: Video: h264 (Baseline), yuv420p, 960x544, 25 fps, 25 tbr, 1200k tbn, 50 tbc
[buffer @ 0xa508070] w:960 h:544 pixfmt:yuv420p
[scale @ 0xa5087d0] w:960 h:544 fmt:yuv420p -> w:640 h:480 fmt:yuv420p flags:0xa0000004
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf53.0.3
    Stream #0.0: Video: rawvideo, yuv420p, 640x480, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
[buffer @ 0xa508070] Changing filter graph input to accept 1920x1088 0 (0 0)
[scale @ 0xa5087d0] w:1920 h:1088 fmt:yuv420p -> w:960 h:544 fmt:yuv420p flags:0x2
Input stream #0.0 frame changed from size:960x544 fmt:yuv420p to size:1920x1088 fmt:yuv420p
[h264 @ 0x7c226a0] no frame!ze=      -0kB time=0.72 bitrate=  -0.2kbits/s
Error while decoding stream #0.0
==14176== Conditional jump or move depends on uninitialised value(s)
==14176==    at 0x85C37B7: av_log_default_callback (log.c:120)
==14176==
frame=   18 fps=  5 q=0.0 Lsize=      -0kB time=0.72 bitrate=  -0.2kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -inf%
==14176==
==14176== HEAP SUMMARY:
==14176==     in use at exit: 1,715,756 bytes in 48 blocks
==14176==   total heap usage: 1,115 allocs, 1,067 frees, 46,171,733 bytes allocated
==14176==
==14176== LEAK SUMMARY:
==14176==    definitely lost: 123,904 bytes in 2 blocks
==14176==    indirectly lost: 1,505,834 bytes in 45 blocks
==14176==      possibly lost: 86,018 bytes in 1 blocks
==14176==    still reachable: 0 bytes in 0 blocks
==14176==         suppressed: 0 bytes in 0 blocks
==14176== Rerun with --leak-check=full to see details of leaked memory
==14176==
==14176== For counts of detected and suppressed errors, rerun with: -v
==14176== Use --track-origins=yes to see where uninitialised values come from
==14176== ERROR SUMMARY: 3 errors from 2 contexts (suppressed: 3 from 3)

Change History (1)

comment:1 by Stefano Sabatini, 13 years ago

Analyzed by developer: set
Component: undeterminedavfilter
Reproduced by developer: set
Resolution: fixed
Status: newclosed

Fixed in:

commit f97905e61d7cb86987d7d4f5fabcfc0d6b57ddbb
Author: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Date: Mon May 2 12:35:39 2011 +0200

scale: fix leak occurring when a scale filter is reconfigured


This currently only occurrs in vsrc_buffer in case of mid-stream
size/format change.


Fix trac issue #124.

Note: See TracTickets for help on using tickets.