Opened 9 years ago

Closed 9 years ago

#4886 closed defect (fixed)

image2 demuxer memory leak

Reported by: pszemus Owned by:
Priority: important Component: avformat
Version: git-master Keywords: image2 leak regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Unfortunately, in my use-case, some URLs that were once images are now HTTP redirections to a non-image resource.

$$ valgrind --leak-check=full ./ffmpeg_g -i http://i.hityczykity.pl/uploads/tx_hck/zdjecia_pojedynki/350_1_01.jpg -f mjpeg /dev/null
==26341== Memcheck, a memory error detector
==26341== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==26341== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==26341== Command: ./ffmpeg_g -i http://i.hityczykity.pl/uploads/tx_hck/zdjecia_pojedynki/350_1_01.jpg -f mjpeg /dev/null
==26341== 
ffmpeg version N-75566-ga58c22d Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --prefix=/home/pszemus/ffmpeg-2.8/build --enable-pic --enable-pthreads --enable-libmp3lame --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-gpl --enable-nonfree --enable-libvpx --enable-libvorbis --enable-libx264 --pkg-config-flags=--static --enable-protocol=https --enable-openssl --extra-cflags=-I/opt/WP/common.libs/inc --extra-ldflags='-L/opt/WP/common.libs/lib -ldl'
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  9.100 /  6.  9.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
[image2 @ 0x9a221e0] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
http://i.hityczykity.pl/uploads/tx_hck/zdjecia_pojedynki/350_1_01.jpg: could not find codec parameters
Input #0, image2, from 'http://i.hityczykity.pl/uploads/tx_hck/zdjecia_pojedynki/350_1_01.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 25 tbr, 25 tbn, 25 tbc
Output #0, mjpeg, to '/dev/null':
Output file #0 does not contain any stream
==26341== 
==26341== HEAP SUMMARY:
==26341==     in use at exit: 125,228 bytes in 2,855 blocks
==26341==   total heap usage: 3,176 allocs, 321 frees, 339,361 bytes allocated
==26341== 
==26341== 39,746 (192 direct, 39,554 indirect) bytes in 1 blocks are definitely lost in loss record 232 of 232
==26341==    at 0x4C2BD2C: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==26341==    by 0x4C2BDF1: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==26341==    by 0xE3ED0C: av_malloc (mem.c:97)
==26341==    by 0xE3EECD: av_mallocz (mem.c:254)
==26341==    by 0x580DBB: avio_alloc_context (aviobuf.c:121)
==26341==    by 0x581930: ffio_fdopen (aviobuf.c:791)
==26341==    by 0x583282: avio_open2 (aviobuf.c:927)
==26341==    by 0x5BE046: ff_img_read_packet (img2dec.c:393)
==26341==    by 0x67DE7D: ff_read_packet (utils.c:672)
==26341==    by 0x67EAD0: read_frame_internal (utils.c:1322)
==26341==    by 0x68091A: avformat_find_stream_info (utils.c:3252)
==26341==    by 0x48E15B: open_input_file (ffmpeg_opt.c:945)
==26341== 
==26341== LEAK SUMMARY:
==26341==    definitely lost: 192 bytes in 1 blocks
==26341==    indirectly lost: 39,554 bytes in 9 blocks
==26341==      possibly lost: 0 bytes in 0 blocks
==26341==    still reachable: 85,482 bytes in 2,845 blocks
==26341==         suppressed: 0 bytes in 0 blocks
==26341== Reachable blocks (those to which a pointer was found) are not shown.
==26341== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==26341== 
==26341== For counts of detected and suppressed errors, rerun with: -v
==26341== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)

Change History (2)

comment:1 by Carl Eugen Hoyos, 9 years ago

Component: undeterminedavformat
Keywords: image2 leak regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Summary: Memory leakimage2 demuxer memory leak
Version: unspecifiedgit-master

comment:2 by Carl Eugen Hoyos, 9 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.