diff options
author | aybe aybe <aybe.one@hotmail.com> | 2024-01-02 02:52:11 +0000 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-01-11 17:09:45 +0100 |
commit | f89a6e7576f2099d1cf41e1418fecfb235c240ba (patch) | |
tree | dbdd69ad24398b6e197f29467833601d385e5235 | |
parent | 21ed52916d5843a8ab64a9a21131935886e8dd76 (diff) | |
download | ffmpeg-f89a6e7576f2099d1cf41e1418fecfb235c240ba.tar.gz |
avformat/psxstr: fix demuxing I/O error at EOF
This second patch fixes the following error at the end of a .STR stream conversion:
[in#0/psxstr @ 0000000000681e80] Error during demuxing: I/O error
It's been a bit of trial and error as I've never used ffmpeg, but returning AVERROR_EOF appears to be the way to go (doesn't complain anymore).
Signed-off-by: aybe <aybe@users.noreply.github.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/psxstr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index 22867416d9..009699e288 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -166,8 +166,12 @@ static int str_read_packet(AVFormatContext *s, AVStream *st; while (1) { + int read = avio_read(pb, sector, RAW_CD_SECTOR_SIZE); - if (avio_read(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE) + if (read == AVERROR_EOF) + return AVERROR_EOF; + + if (read != RAW_CD_SECTOR_SIZE) return AVERROR(EIO); channel = sector[0x11]; |