[FFmpeg-trac] #8030(avutil:new): IMGUTILS, failure handling big images
FFmpeg
trac at avcodec.org
Thu Mar 7 08:42:42 EET 2024
#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
More information about the FFmpeg-trac
mailing list