avcodec/libvorbisdec: avoid overflow when assinging sample rate from long to int
Fixes: 416134551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_DEC_fuzzer-6096101407260672 Found-by: OSS-Fuzz Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
parent
286a3892a8
commit
2287a19abb
1 changed files with 6 additions and 0 deletions
|
|
@ -114,6 +114,12 @@ static av_cold int oggvorbis_decode_init(AVCodecContext *avccontext)
|
|||
}
|
||||
}
|
||||
|
||||
if (context->vi.rate <= 0 || context->vi.rate > INT_MAX) {
|
||||
av_log(avccontext, AV_LOG_ERROR, "vorbis rate is invalid\n");
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
|
||||
av_channel_layout_uninit(&avccontext->ch_layout);
|
||||
avccontext->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
|
||||
avccontext->ch_layout.nb_channels = context->vi.channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue