avformat/mp3dec; Check for avio_size() failure

Fixes: CID1608710 Improper use of negative value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bb936a1a72)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 7 months ago
parent 7271c1b523
commit 3b8cb4dc26
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      libavformat/mp3dec.c

@ -137,9 +137,10 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration
int fill_index = (mp3->usetoc || fast_seek) && duration > 0;
if (!filesize &&
!(filesize = avio_size(s->pb))) {
(filesize = avio_size(s->pb)) <= 0) {
av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");
fill_index = 0;
filesize = 0;
}
for (i = 0; i < XING_TOC_COUNT; i++) {

Loading…
Cancel
Save