1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avutil/frame: Check log2_crop_align

Fixes: CID1604586 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15540b3d28676d5e797764a04f6681dcd01736f8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-11 23:04:42 +02:00
parent 1ec463fc79
commit da76e55b93
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -1040,7 +1040,7 @@ int av_frame_apply_cropping(AVFrame *frame, int flags)
if (log2_crop_align < min_log2_align)
return AVERROR_BUG;
if (min_log2_align < 5) {
if (min_log2_align < 5 && log2_crop_align != INT_MAX) {
frame->crop_left &= ~((1 << (5 + log2_crop_align - min_log2_align)) - 1);
calc_cropping_offsets(offsets, frame, desc);
}