Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#10045 closed defect (fixed)

cfhd enc assertion

Reported by: ami_stuff Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

./ffmpeg_g -i 1600.jpg -vcodec cfhd -y out.avi
ffmpeg version N-109101-g822da7a317 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: 
  libavutil      57. 42.100 / 57. 42.100
  libavcodec     59. 52.102 / 59. 52.102
  libavformat    59. 34.101 / 59. 34.101
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 50.100 /  8. 50.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
[mjpeg @ 0x5590c08e5d40] EOI missing, emulating
Input #0, jpeg_pipe, from '1600.jpg':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1600x1, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> cfhd (native))
Press [q] to stop, [?] for help
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c09266c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0954f80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0983380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c09b1780] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c09dfb80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a0df80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a3c380] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a6a780] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a98b80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a8d700] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a9a6c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0951dc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a13300] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a40d40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c09e3140] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a6b640] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0984e40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c09b3240] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c09266c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a8d700] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0949a80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a097c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0988180] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c09b5040] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a3dc40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c09e2bc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c0919200] [swscaler @ 0x5590c0a6b640] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a8d700] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a9a6c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0949a80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a015c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c097cc40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c09ab740] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a65140] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c0a39080] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5590c09266c0] [swscaler @ 0x5590c09dcf00] deprecated pixel format used, make sure you did set range correctly
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf59.34.101
  Stream #0:0: Video: cfhd (CFHD / 0x44484643), yuv422p10le(tv, bt470bg/unknown/unknown, progressive), 1600x1, q=2-31, 200 kb/s, 25 fps, 25 tbn
    Metadata:
      encoder         : Lavc59.52.102 cfhd
frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbInternal error, put_bits buffer too small
    Last message repeated 30 times
Assertion s->buf_ptr < s->buf_end failed at libavcodec/put_bits.h:150
==11427== Thread 19:
==11427== Invalid read of size 16
==11427==    at 0xF36012: ??? (in /ffmpeg_g)
==11427==    by 0xF00BBFF: ???
==11427==    by 0x752474: cfhd_encode_frame (cfhdenc.c:454)
==11427==    by 0x7BD6B1: ff_encode_encode_cb (encode.c:199)
==11427==    by 0x8142D1: worker (frame_thread_encoder.c:114)
==11427==    by 0x4FBC608: start_thread (pthread_create.c:477)
==11427==    by 0x50F6132: clone (clone.S:95)
==11427==  Address 0xefdbe94 is 3,220 bytes inside a block of size 3,232 alloc'd
==11427==    at 0x483E0F0: memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==11427==    by 0x483E212: posix_memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==11427==    by 0x106E624: av_malloc (mem.c:105)
==11427==    by 0x105AF29: av_buffer_alloc (buffer.c:82)
==11427==    by 0x105AFA3: av_buffer_allocz (buffer.c:95)
==11427==    by 0x105B70C: pool_alloc_buffer (buffer.c:363)
==11427==    by 0x105B70C: av_buffer_pool_get (buffer.c:401)
==11427==    by 0x2FF8E0: ff_frame_pool_get (framepool.c:217)
==11427==    by 0x48225A: ff_default_get_video_buffer2 (video.c:87)
==11427==    by 0x482350: ff_get_video_buffer (video.c:108)
==11427==    by 0x4154AC: scale_frame (vf_scale.c:765)
==11427==    by 0x415F3B: filter_frame (vf_scale.c:860)
==11427==    by 0x2EEF59: ff_filter_frame_framed (avfilter.c:1000)
==11427==    by 0x2EEF59: ff_filter_frame_to_filter (avfilter.c:1144)
==11427==    by 0x2EEF59: ff_filter_activate_default (avfilter.c:1193)
==11427==    by 0x2EEF59: ff_filter_activate (avfilter.c:1352)

Attachments (1)

1600.jpg (1.7 KB ) - added by ami_stuff 2 years ago.

Download all attachments as: .zip

Change History (4)

by ami_stuff, 2 years ago

Attachment: 1600.jpg added

comment:1 by Elon Musk, 2 years ago

Resolution: fixed
Status: newclosed

comment:2 by ami_stuff, 2 years ago

I still get invalid reads with valgrind.

valgrind --leak-check=full ./ffmpeg_g -i 1600.jpg -vcodec cfhd -y out.avi
==19073== Memcheck, a memory error detector
==19073== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==19073== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==19073== Command: ./ffmpeg_g -i 1600.jpg -vcodec cfhd -y out.avi
==19073== 
ffmpeg version N-109332-g45ab5307a6 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --enable-libopenjpeg
  libavutil      57. 43.100 / 57. 43.100
  libavcodec     59. 54.100 / 59. 54.100
  libavformat    59. 34.102 / 59. 34.102
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 51.100 /  8. 51.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
[mjpeg @ 0x5cb9200] EOI missing, emulating
Input #0, jpeg_pipe, from '1600.jpg':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1600x1, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> cfhd (native))
Press [q] to stop, [?] for help
[swscaler @ 0x5d68100] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x601a480] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xeadcf40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0xed8e6c0] deprecated pixel format used, make sure you did set range correctly
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf59.34.102
  Stream #0:0: Video: cfhd (CFHD / 0x44484643), yuv422p10le(tv, bt470bg/unknown/unknown, progressive), 1600x1, q=2-31, 200 kb/s, 25 fps, 25 tbn
    Metadata:
      encoder         : Lavc59.54.100 cfhd
frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kb==19073== Thread 19:
==19073== Invalid read of size 16
==19073==    at 0xF3A482: ??? (in ffmpeg_g)
==19073==    by 0xF070F3F: ???
==19073==    by 0x755194: cfhd_encode_frame (cfhdenc.c:454)
==19073==    by 0x7C0431: ff_encode_encode_cb (encode.c:199)
==19073==    by 0x8170A1: worker (frame_thread_encoder.c:114)
==19073==    by 0x502A608: start_thread (pthread_create.c:477)
==19073==    by 0x5166132: clone (clone.S:95)
==19073==  Address 0xf0411d4 is 3,220 bytes inside a block of size 3,232 alloc'd
==19073==    at 0x483E0F0: memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==19073==    by 0x483E212: posix_memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==19073==    by 0x1072AB4: av_malloc (mem.c:105)
==19073==    by 0x105F3B9: av_buffer_alloc (buffer.c:82)
==19073==    by 0x105F433: av_buffer_allocz (buffer.c:95)
==19073==    by 0x105FB9C: pool_alloc_buffer (buffer.c:363)
==19073==    by 0x105FB9C: av_buffer_pool_get (buffer.c:401)
==19073==    by 0x3064C0: ff_frame_pool_get (framepool.c:217)
==19073==    by 0x488E5A: ff_default_get_video_buffer2 (video.c:87)
==19073==    by 0x488F50: ff_get_video_buffer (video.c:108)
==19073==    by 0x41C0AC: scale_frame (vf_scale.c:765)
==19073==    by 0x41CB3B: filter_frame (vf_scale.c:860)
==19073==    by 0x2F5B19: ff_filter_frame_framed (avfilter.c:1000)
==19073==    by 0x2F5B19: ff_filter_frame_to_filter (avfilter.c:1144)
==19073==    by 0x2F5B19: ff_filter_activate_default (avfilter.c:1193)
==19073==    by 0x2F5B19: ff_filter_activate (avfilter.c:1352)
==19073== 
==19073== Invalid read of size 16
==19073==    at 0xF3A4BC: ??? (in ffmpeg_g)
==19073==    by 0xF070F3F: ???
==19073==    by 0x755194: cfhd_encode_frame (cfhdenc.c:454)
==19073==    by 0x7C0431: ff_encode_encode_cb (encode.c:199)
==19073==    by 0x8170A1: worker (frame_thread_encoder.c:114)
==19073==    by 0x502A608: start_thread (pthread_create.c:477)
==19073==    by 0x5166132: clone (clone.S:95)
==19073==  Address 0xf0411d8 is 3,224 bytes inside a block of size 3,232 alloc'd
==19073==    at 0x483E0F0: memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==19073==    by 0x483E212: posix_memalign (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==19073==    by 0x1072AB4: av_malloc (mem.c:105)
==19073==    by 0x105F3B9: av_buffer_alloc (buffer.c:82)
==19073==    by 0x105F433: av_buffer_allocz (buffer.c:95)
==19073==    by 0x105FB9C: pool_alloc_buffer (buffer.c:363)
==19073==    by 0x105FB9C: av_buffer_pool_get (buffer.c:401)
==19073==    by 0x3064C0: ff_frame_pool_get (framepool.c:217)
==19073==    by 0x488E5A: ff_default_get_video_buffer2 (video.c:87)
==19073==    by 0x488F50: ff_get_video_buffer (video.c:108)
==19073==    by 0x41C0AC: scale_frame (vf_scale.c:765)
==19073==    by 0x41CB3B: filter_frame (vf_scale.c:860)
==19073==    by 0x2F5B19: ff_filter_frame_framed (avfilter.c:1000)
==19073==    by 0x2F5B19: ff_filter_frame_to_filter (avfilter.c:1144)
==19073==    by 0x2F5B19: ff_filter_activate_default (avfilter.c:1193)
==19073==    by 0x2F5B19: ff_filter_activate (avfilter.c:1352)

comment:3 by Elon Musk, 2 years ago

Just disabled heights of < 4. IT is pointless to encode such sizes.

Note: See TracTickets for help on using tickets.