Opened 11 years ago

Closed 11 years ago

#2940 closed defect (fixed)

mjpeg: fix a crash with lowres and 12bpp grayscale

Reported by: ami_stuff Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mjpeg lowres crash
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

http://ffmpeg.org/trac/ffmpeg/raw-attachment/ticket/2812/12bpp_extended.jpg

(gdb) r -vlowres 3 -i 12bpp_extended.jpg out.bmp
Starting program: D:\MinGW\msys\1.0\ffmpeg-HEAD-a67dcd7\ffmpeg_g.exe -vlowres 3
-i 12bpp_extended.jpg out.bmp
[New Thread 3900.0xeac]
ffmpeg version 2.0-a67dcd7 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep  5 2013 17:46:37 with gcc 4.6.2 (GCC)
  configuration: --disable-w32threads --disable-yasm --disable-ffprobe --enable-
gpl
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 31.101 / 55. 31.101
  libavformat    55. 16.101 / 55. 16.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 83.102 /  3. 83.102
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from '12bpp_extended.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, gray16le(12 bpc), 128x96 [SAR 96:96 DAR 4:3], 25
tbr, 25 tbn, 25 tbc
File 'out.bmp' already exists. Overwrite ? [y/N] y
[New Thread 3900.0x844]
[New Thread 3900.0x8a4]
[New Thread 3900.0xdec]
[New Thread 3900.0xfe4]
[New Thread 3900.0xce4]
[New Thread 3900.0xe24]
[New Thread 3900.0xe14]
[New Thread 3900.0x9c8]
[New Thread 3900.0x5e4]
Output #0, image2, to 'out.bmp':
  Metadata:
    encoder         : Lavf55.16.101
    Stream #0:0: Video: bmp, gray, 128x96 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 9
0k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> bmp)
Press [q] to stop, [?] for help
[mjpeg @ 04de69e0] error count: 64
[mjpeg @ 04de69e0] error y=91 x=47

Program received signal SIGSEGV, Segmentation fault.
0x7c911689 in ntdll!RtlInitializeHandleTable ()
   from C:\WINDOWS\system32\ntdll.dll
(gdb) bt
#0  0x7c911689 in ntdll!RtlInitializeHandleTable ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7c91084c in wcsncpy () from C:\WINDOWS\system32\ntdll.dll
#2  0x77c1c2de in msvcrt!free () from C:\WINDOWS\system32\msvcrt.dll
#3  0x04d00000 in ?? ()
#4  0x00af29b3 in av_buffer_unref (buf=0x4d0e788) at libavutil/buffer.c:115
#5  0x00aedf1a in av_frame_unref (frame=0x4d0e620) at libavutil/frame.c:347
#6  0x004100de in reap_filters () at ffmpeg.c:1110
#7  0x00b0ac11 in transcode_step () at ffmpeg.c:3190
#8  transcode () at ffmpeg.c:3233
#9  main (argc=6, argv=<optimized out>) at ffmpeg.c:3411
(gdb)

Change History (4)

comment:1 by ami_stuff, 11 years ago

Summary: mjpeg: gix a crash with lowres and 12bpp grayscalemjpeg: fix a crash with lowres and 12bpp grayscale

comment:2 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavcodec
Keywords: j2k lowres crash added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master
$ valgrind ffmpeg_g -lowres 1 -i 12bpp_progressive.jpg -f null -
==13816== Memcheck, a memory error detector
==13816== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==13816== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==13816== Command: ffmpeg_g -lowres 1 -i 12bpp_progressive.jpg -f null -
==13816==
ffmpeg version N-56121-g43497d8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep  8 2013 23:57:36 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 31.101 / 55. 31.101
  libavformat    55. 16.101 / 55. 16.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 84.100 /  3. 84.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from '12bpp_progressive.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, gray16le(12 bpc), 512x384 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.16.101
    Stream #0:0: Video: rawvideo (Y1[0][16] / 0x10003159), gray16le(12 bpc), 512x384 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> rawvideo)
Press [q] to stop, [?] for help
==13816== Invalid read of size 2
==13816==    at 0x8966B5: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc619e is 395,294 bytes inside a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x8966BA: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc619e is 395,294 bytes inside a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x896669: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc619e is 395,294 bytes inside a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x89666E: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc619e is 395,294 bytes inside a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x89667C: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a0 is 1 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x896681: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a0 is 1 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x89668F: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a2 is 3 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x896694: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a2 is 3 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x8966A2: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a4 is 5 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x8966A7: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a4 is 5 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x896630: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a0 is 1 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x896635: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a0 is 1 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x896643: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a2 is 3 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x896648: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a2 is 3 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 2
==13816==    at 0x896656: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a4 is 5 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid write of size 2
==13816==    at 0x89665B: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13816==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xbfc61a4 is 5 bytes after a block of size 395,295 alloc'd
==13816==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13816==    by 0xC1A579: av_malloc (mem.c:93)
==13816==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13816==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13816==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13816==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13816==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13816==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13816==    by 0x8978BE: ff_mjpeg_decode_frame (mjpegdec.c:1839)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==
==13816== Invalid read of size 4
==13816==    at 0xC0E2B9: av_buffer_ref (atomic_gcc.h:45)
==13816==    by 0xC15605: av_frame_ref (frame.c:268)
==13816==    by 0x8978F0: ff_mjpeg_decode_frame (mjpegdec.c:1875)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  Address 0xfc00400c is not stack'd, malloc'd or (recently) free'd
==13816==
==13816==
==13816== Process terminating with default action of signal 11 (SIGSEGV)
==13816==  Access not within mapped region at address 0xFC00400C
==13816==    at 0xC0E2B9: av_buffer_ref (atomic_gcc.h:45)
==13816==    by 0xC15605: av_frame_ref (frame.c:268)
==13816==    by 0x8978F0: ff_mjpeg_decode_frame (mjpegdec.c:1875)
==13816==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13816==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13816==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13816==    by 0x45D8FF: main (ffmpeg.c:3181)
==13816==  If you believe this happened as a result of a stack
==13816==  overflow in your program's main thread (unlikely but
==13816==  possible), you can try to increase the size of the
==13816==  main thread stack using the --main-stacksize= flag.
==13816==  The main thread stack size used in this run was 8388608.
==13816==
==13816== HEAP SUMMARY:
==13816==     in use at exit: 3,492,441 bytes in 104 blocks
==13816==   total heap usage: 1,672 allocs, 1,568 frees, 7,354,565 bytes allocated
==13816==
==13816== LEAK SUMMARY:
==13816==    definitely lost: 104 bytes in 3 blocks
==13816==    indirectly lost: 0 bytes in 0 blocks
==13816==      possibly lost: 2,448 bytes in 9 blocks
==13816==    still reachable: 3,489,889 bytes in 92 blocks
==13816==         suppressed: 0 bytes in 0 blocks
==13816== Rerun with --leak-check=full to see details of leaked memory
==13816==
==13816== For counts of detected and suppressed errors, rerun with: -v
==13816== ERROR SUMMARY: 1333 errors from 17 contexts (suppressed: 2 from 2)
Killed
$ valgrind ffmpeg_g -lowres 1 -i 12bpp_extended.jpg -f null -
==13758== Memcheck, a memory error detector
==13758== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==13758== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==13758== Command: ffmpeg_g -lowres 1 -i 12bpp_extended.jpg -f null -
==13758==
ffmpeg version N-56121-g43497d8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep  8 2013 23:57:36 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 43.100 / 52. 43.100
  libavcodec     55. 31.101 / 55. 31.101
  libavformat    55. 16.101 / 55. 16.101
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 84.100 /  3. 84.100
  libswscale      2.  5.100 /  2.  5.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from '12bpp_extended.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, gray16le(12 bpc), 512x384 [SAR 96:96 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.16.101
    Stream #0:0: Video: rawvideo (Y1[0][16] / 0x10003159), gray16le(12 bpc), 512x384 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> rawvideo)
Press [q] to stop, [?] for help
==13758== Invalid read of size 2
==13758==    at 0x895B1B: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe8989e is 395,294 bytes inside a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895B20: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe8989e is 395,294 bytes inside a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895ACF: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe8989e is 395,294 bytes inside a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895AD4: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe8989e is 395,294 bytes inside a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895AE2: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a0 is 1 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895AE7: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a0 is 1 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895AF5: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a2 is 3 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895AFA: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a2 is 3 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895B08: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a4 is 5 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895B0D: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a4 is 5 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895A96: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a0 is 1 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895A9B: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a0 is 1 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895AA9: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a2 is 3 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895AAE: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a2 is 3 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid read of size 2
==13758==    at 0x895ABC: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a4 is 5 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
==13758== Invalid write of size 2
==13758==    at 0x895AC1: ff_mjpeg_decode_sos (mjpegdec.c:1053)
==13758==    by 0x8977F9: ff_mjpeg_decode_frame (mjpegdec.c:1897)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==    by 0x46F78E: process_input (ffmpeg.c:1866)
==13758==    by 0x45D8FF: main (ffmpeg.c:3181)
==13758==  Address 0xbe898a4 is 5 bytes after a block of size 395,295 alloc'd
==13758==    at 0x4C290FE: memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0x4C291A7: posix_memalign (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13758==    by 0xC1A579: av_malloc (mem.c:93)
==13758==    by 0xC0E1DD: av_buffer_allocz (buffer.c:70)
==13758==    by 0xC0E7BB: av_buffer_pool_get (buffer.c:305)
==13758==    by 0x9D6FAB: video_get_buffer (utils.c:575)
==13758==    by 0x9D8756: get_buffer_internal (utils.c:865)
==13758==    by 0x9D8C65: ff_get_buffer (utils.c:877)
==13758==    by 0x891E7A: ff_mjpeg_decode_sof (mjpegdec.c:468)
==13758==    by 0x897745: ff_mjpeg_decode_frame (mjpegdec.c:1853)
==13758==    by 0x9DA89A: avcodec_decode_video2 (utils.c:1983)
==13758==    by 0x46C48F: decode_video (ffmpeg.c:1668)
==13758==
[mjpeg @ 0x7237fe0] mjpeg_decode_dc: bad vlc: 0:0 (0x751d0c0)
[mjpeg @ 0x7237fe0] error dc
[mjpeg @ 0x7237fe0] error y=95 x=8
[null @ 0x74347a0] Encoder did not produce proper pts, making some up.
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead -122.916667%
==13758==
==13758== HEAP SUMMARY:
==13758==     in use at exit: 0 bytes in 0 blocks
==13758==   total heap usage: 1,677 allocs, 1,677 frees, 4,245,564 bytes allocated
==13758==
==13758== All heap blocks were freed -- no leaks are possible
==13758==
==13758== For counts of detected and suppressed errors, rerun with: -v
==13758== ERROR SUMMARY: 76 errors from 16 contexts (suppressed: 2 from 2)

comment:3 by Carl Eugen Hoyos, 11 years ago

Keywords: mjpeg added; j2k removed

comment:4 by Michael Niedermayer, 11 years ago

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