From 2030d681e4dd24e036d6e2c178cfb818e8f2b222 Mon Sep 17 00:00:00 2001 From: "roman.artiukhin" Date: Thu, 2 Nov 2023 09:40:56 +0200 Subject: Codecs: mp4: Fix sign overflow in seek by offset Change-Id: I52f536ae959f989c3dc70a50cb802eb1b8615642 --- lib/rbcodec/codecs/libm4a/m4a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbcodec/codecs/libm4a/m4a.c b/lib/rbcodec/codecs/libm4a/m4a.c index 1672cf300c..ecae2ad633 100644 --- a/lib/rbcodec/codecs/libm4a/m4a.c +++ b/lib/rbcodec/codecs/libm4a/m4a.c @@ -306,7 +306,7 @@ unsigned int m4a_seek_raw(demux_res_t* demux_res, stream_t* stream, new_sound_sample += tmp_cnt * tmp_dur; if (chunk_sample <= total_samples) { - new_sound_sample += (chunk_sample - total_samples) * tmp_dur; + new_sound_sample -= (total_samples - chunk_sample) * tmp_dur; break; } ++i; -- cgit v1.2.3