mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-11 08:13:06 +00:00
avcodec/libtheoraenc: make keyframe mask unsigned and handle its larger range
Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 473579864/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBTHEORA_fuzzer-5835688160591872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
ca011ee754
commit
c98346ffaa
@@ -53,7 +53,7 @@ typedef struct TheoraContext {
|
||||
int stats_offset;
|
||||
int uv_hshift;
|
||||
int uv_vshift;
|
||||
int keyframe_mask;
|
||||
unsigned keyframe_mask;
|
||||
int speed_level;
|
||||
} TheoraContext;
|
||||
|
||||
@@ -249,7 +249,7 @@ static av_cold int encode_init(AVCodecContext* avc_context)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
h->keyframe_mask = (1 << av_ceil_log2(avc_context->gop_size)) - 1;
|
||||
h->keyframe_mask = (1U << av_ceil_log2(avc_context->gop_size)) - 1;
|
||||
/* Clear up theora_info struct */
|
||||
th_info_clear(&t_info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user