pb->eof_reached is set on error, so we need to check pb->error, even after checking pb->eof_reached or avio_feof(pb), or else we can end up returning AVERROR_EOF instead of the actual error code. --- libavformat/matroskadec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index d3c9c33720..2774ccabb2 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -789,7 +789,7 @@ static int matroska_resync(MatroskaDemuxContext *matroska, int64_t last_pos) } matroska->done = 1; - return AVERROR_EOF; + return pb->error ? pb->error : AVERROR_EOF; } /* @@ -836,7 +836,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb, pos, pos); return pb->error ? pb->error : AVERROR(EIO); } - return AVERROR_EOF; + return pb->error ? pb->error : AVERROR_EOF; } /* get the length of the EBML number */ -- 2.19.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel