avformat/rmdec: use 64bit for audio_framesize checks

It is not entirely clear what would prevent such overflow so even if it is
not possible, it is better to use 64bit

Fixes: CID1491898 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 665be4fa2f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-07 21:57:40 +02:00
parent 9f223bdd89
commit 99d609a44e
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 2 deletions

View File

@ -268,9 +268,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
case DEINT_ID_INT4:
if (ast->coded_framesize > ast->audio_framesize ||
sub_packet_h <= 1 ||
ast->coded_framesize * (uint64_t)sub_packet_h > (2 + (sub_packet_h & 1)) * ast->audio_framesize)
ast->coded_framesize * (uint64_t)sub_packet_h > (2LL + (sub_packet_h & 1)) * ast->audio_framesize)
return AVERROR_INVALIDDATA;
if (ast->coded_framesize * (uint64_t)sub_packet_h != 2*ast->audio_framesize) {
if (ast->coded_framesize * (uint64_t)sub_packet_h != 2LL*ast->audio_framesize) {
avpriv_request_sample(s, "mismatching interleaver parameters");
return AVERROR_INVALIDDATA;
}