avformat/mp3dec: change bogus error message if read_header encounters EOF

Because of ffio_ensure_seekback() a seek error normally should only happen if
the end of file is reached during checking for the junk run-in. Also use proper
error code.

Signed-off-by: Marton Balint <cus@passwd.hu>
release/7.1
Marton Balint 6 months ago
parent b75e604fe5
commit 49e018d6fe
  1. 4
      libavformat/mp3dec.c

@ -415,8 +415,8 @@ static int mp3_read_header(AVFormatContext *s)
if (ret >= 0 && (header & MP3_MASK) == (header2 & MP3_MASK)) if (ret >= 0 && (header & MP3_MASK) == (header2 & MP3_MASK))
break; break;
} else if (frame_size == CHECK_SEEK_FAILED) { } else if (frame_size == CHECK_SEEK_FAILED) {
av_log(s, AV_LOG_ERROR, "Failed to read frame size: Could not seek to %"PRId64".\n", (int64_t) (i + 1024 + frame_size + 4)); av_log(s, AV_LOG_ERROR, "Failed to find two consecutive MPEG audio frames.\n");
return AVERROR(EINVAL); return AVERROR_INVALIDDATA;
} }
} }
if (i == 64 * 1024) { if (i == 64 * 1024) {

Loading…
Cancel
Save