#8030(undetermined:new): IMGUTILS, failure handling big images
#8030: IMGUTILS, failure handling big images -------------------------------------+------------------------------------- Reporter: gdgsdg123 | Type: | enhancement Status: new | Priority: normal Component: | Version: git- undetermined | master Keywords: IMGUTILS, | Blocked By: image size | Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: {{{ [IMGUTILS @ 00000000002ff660] Picture size 9578x27586 is invalid [png @ 00000000029885c0] [IMGUTILS @ 00000000002fee70] Picture size 27586x9578 is invalid [png @ 00000000029885c0] Invalid image size }}} How to reproduce: {{{ C:\>ffprobe x.png ffprobe version N-94324-g806ac7da69 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 9.1.1 (GCC) 20190716 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable- fontconfig --enable-gnutls --enable-iconv --enable-libass --enable- libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable- libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable- nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 30.100 / 56. 30.100 libavcodec 58. 53.101 / 58. 53.101 libavformat 58. 28.102 / 58. 28.102 libavdevice 58. 7.100 / 58. 7.100 libavfilter 7. 56.101 / 7. 56.101 libswscale 5. 4.101 / 5. 4.101 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 [IMGUTILS @ 00000000002ff660] Picture size 9578x27586 is invalid [png @ 00000000029885c0] [IMGUTILS @ 00000000002fee70] Picture size 27586x9578 is invalid [png @ 00000000029885c0] Invalid image size [png_pipe @ 00000000003f3980] Stream #0: not enough frames to estimate rate; consider increasing probesize [png_pipe @ 00000000003f3980] decoding for stream 0 failed [png_pipe @ 00000000003f3980] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, png_pipe, from 'x.png': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, none(pc), 25 tbr, 25 tbn, 25 tbc }}} Build from: https://zeranoe.com/builds/win64/static/ffmpeg-20190716 -806ac7d-win64-static.zip Also happens on images of similar size (e.g. 16256x16256). The content of the image doesn't seem to matter. -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Changes (by cehoyos): * keywords: IMGUTILS, image size => * priority: normal => wish * component: undetermined => avutil -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
The content of the image doesn't seem to matter. Of course not. But don't you agree that for whoever is interested in this ticket, a file
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Comment (by cehoyos): Replying to [ticket:8030 gdgsdg123]: that shows your actual usecase would make things much easier? -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Comment (by gdgsdg123): Replying to [comment:2 cehoyos]:
Replying to [ticket:8030 gdgsdg123]:
The content of the image doesn't seem to matter. Of course not. But don't you agree that for whoever is interested in this ticket, a file that shows your actual usecase would make things much easier? I mean... it seems to occur with any image of a similar size.
-- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Comment (by cehoyos): So why don't you provide one? Just to make it more difficult to fix the issue or is there another reason? -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Comment (by Cigaes): Do we really need to clutter the bugtracker with attached files that could be generated in a few seconds with: {{{ rawtoppm 16256 16256 /dev/zero | pnmtopng > big.png }}} ? -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Changes (by Cigaes): * Attachment "big.png" added. rawtoppm 16256 16256 /dev/zero | pnmtopng > big.png -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Changes (by cehoyos): * reproduced: 0 => 1 Comment: While the following may be a good idea, it does not help with this issue as the pix_fmt is not yet known when `av_image_get_buffer_size()` is called. {{{ diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index c733cb5cf5..f308422636 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -438,7 +438,7 @@ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, if (!desc) return AVERROR(EINVAL); - ret = av_image_check_size(width, height, 0, NULL); + ret = av_image_check_size2(width, height, INT64_MAX, pix_fmt, 0, NULL); if (ret < 0) return ret; }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8030: IMGUTILS, failure handling big images -------------------------------------+---------------------------------- Reporter: gdgsdg123 | Owner: (none) Type: enhancement | Status: new Priority: wish | Component: avutil Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 1 Analyzed by developer: 0 | -------------------------------------+---------------------------------- Comment (by BenjamÃn de la Fuente Ranea): This is working for me in Windows x64. In the function av_image_check_size2, just use this: {{{ #if defined(_WIN64) #define MAX_MEM_SIZE INT64_MAX #else #define MAX_MEM_SIZE INT_MAX #endif if ((int)w<=0 || (int)h<=0 || stride >= INT_MAX || stride*(uint64_t)(h+128) >= MAX_MEM_SIZE) { av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h); return AVERROR(EINVAL); } }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/8030#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg