]> git.sesse.net Git - ffmpeg/commitdiff
lavf/bluray: translate a read of 0 to EOF
authorJan Ekström <jeebjp@gmail.com>
Sun, 6 May 2018 14:15:52 +0000 (17:15 +0300)
committerJan Ekström <jeebjp@gmail.com>
Sun, 6 May 2018 15:51:33 +0000 (18:51 +0300)
Yet another case of forgotten 0 =! EOF translation. The libbluray
documentation specifically mentions that a read of 0 is EOF.

Reported by Fyr on IRC.

libavformat/bluray.c

index 9282bf99565ba593ae6fe852f52f4c7890f04c18..635c4f1b87628eb3bf9a458b147b33a7da37d8e3 100644 (file)
@@ -198,7 +198,7 @@ static int bluray_read(URLContext *h, unsigned char *buf, int size)
 
     len = bd_read(bd->bd, buf, size);
 
-    return len;
+    return len == 0 ? AVERROR_EOF : len;
 }
 
 static int64_t bluray_seek(URLContext *h, int64_t pos, int whence)