Vitor <vitor1...@gmail.com> added the comment: Reproducible with r24373 compiled with gcc 4.4.3 (produces a solid black image). Bug disappears if I remove full_chroma_int flag. Valgrind complains of reading uninitialized memory, and it is indeed not a false positive, since passing --malloc-fill=0xff to valgrind produces a solid white pic while --malloc-fill=0x00 produces a solid black pic.
vi...@vitor:~$ ffmpeg -i /tmp/1277771652-pavel1.jpg -f image2 -vcodec bmp -pix_fmt rgb565 /tmp/img565.bmp -sws_flags bilinear+full_chroma_int FFmpeg version SVN-r24373, Copyright (c) 2000-2010 the FFmpeg developers built on Jul 20 2010 22:16:37 with gcc 4.4.3 configuration: --cc='ccache gcc' --cpu=host libavutil 50.22. 0 / 50.22. 0 libavcodec 52.84. 0 / 52.84. 0 libavformat 52.76. 0 / 52.76. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.25. 1 / 1.25. 1 libswscale 0.11. 0 / 0.11. 0 Input #0, image2, from '/tmp/img.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: N/A Stream #0.0: Video: mjpeg, yuvj444p, 65x108 [PAR 72:72 DAR 65:108], 25 tbr, 25 tbn, 25 tbc [ffmpeg_output @ 0x8dac580] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out' [scale @ 0x8dabca0] w:65 h:108 fmt:yuvj444p -> w:65 h:108 fmt:rgb565le flags:0x2002 Output #0, image2, to '/tmp/img565.bmp': Metadata: encoder : Lavf52.76.0 Stream #0.0: Video: bmp, rgb565le, 65x108 [PAR 1:1 DAR 65:108], q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding frame= 1 fps= 0 q=0.0 Lsize= -0kB time=0.04 bitrate= -4.4kbits/s video:14kB audio:0kB global headers:0kB muxing overhead -100.153610% ==11973== Memcheck, a memory error detector ==11973== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==11973== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==11973== Command: ffmpeg_g -i /tmp/1277771652-pavel1.jpg -f image2 -vcodec bmp -pix_fmt rgb565 /tmp/img565.bmp -sws_flags bilinear+full_chroma_int ==11973== FFmpeg version SVN-r24373, Copyright (c) 2000-2010 the FFmpeg developers built on Jul 20 2010 22:16:37 with gcc 4.4.3 configuration: --cc='ccache gcc' --cpu=host libavutil 50.22. 0 / 50.22. 0 libavcodec 52.84. 0 / 52.84. 0 libavformat 52.76. 0 / 52.76. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.25. 1 / 1.25. 1 libswscale 0.11. 0 / 0.11. 0 Input #0, image2, from '/tmp/img.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: N/A Stream #0.0: Video: mjpeg, yuvj444p, 65x108 [PAR 72:72 DAR 65:108], 25 tbr, 25 tbn, 25 tbc [ffmpeg_output @ 0x436a0d0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out' [scale @ 0x436a780] w:65 h:108 fmt:yuvj444p -> w:65 h:108 fmt:rgb565le flags:0x2002 Output #0, image2, to '/tmp/img565.bmp': Metadata: encoder : Lavf52.76.0 Stream #0.0: Video: bmp, rgb565le, 65x108 [PAR 1:1 DAR 65:108], q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding ==11973== Syscall param write(buf) points to uninitialised byte(s) ==11973== at 0x4184EB3: __write_nocancel (syscall-template.S:82) ==11973== by 0x809B601: put_flush_packet (aviobuf.c:95) ==11973== by 0x80B47B9: img_write_packet (img2.c:402) ==11973== by 0x8120A19: av_interleaved_write_frame (utils.c:2967) ==11973== by 0x4386173: ??? ==11973== Address 0x43f1452 is 66 bytes inside a block of size 32,768 alloc'd ==11973== at 0x4024106: memalign (vg_replace_malloc.c:581) ==11973== by 0x4024163: posix_memalign (vg_replace_malloc.c:709) ==11973== by 0x854A2C0: av_malloc (mem.c:83) ==11973== by 0x809B078: url_fdopen (aviobuf.c:587) ==11973== by 0x809B1B9: url_fopen (aviobuf.c:695) ==11973== by 0x80B45B1: img_write_packet (img2.c:354) ==11973== by 0x8120A19: av_interleaved_write_frame (utils.c:2967) ==11973== by 0x4386173: ??? ==11973== frame= 1 fps= 0 q=0.0 Lsize= -0kB time=0.04 bitrate= -4.4kbits/s video:14kB audio:0kB global headers:0kB muxing overhead -100.153610% ==11973== ==11973== HEAP SUMMARY: ==11973== in use at exit: 0 bytes in 0 blocks ==11973== total heap usage: 307 allocs, 307 frees, 1,016,157 bytes allocated ==11973== ==11973== All heap blocks were freed -- no leaks are possible ==11973== ==11973== For counts of detected and suppressed errors, rerun with: -v ==11973== Use --track-origins=yes to see where uninitialised values come from ==11973== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 29 from 8) ---------- substatus: needs_more_info -> reproduced title: SWScale, does not convert from YUV444 to RGB565 -> SWScale output junk converting YUV444 -> RGB565 using bilinear+full_chroma_int ________________________________________________ FFmpeg issue tracker <iss...@roundup.ffmpeg.org> <https://roundup.ffmpeg.org/issue2113> ________________________________________________