]> git.sesse.net Git - ffmpeg/commitdiff
avformat/vividas: Use equals check with n in read_sb_block()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 15 Feb 2021 20:29:11 +0000 (21:29 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 Mar 2021 12:20:00 +0000 (14:20 +0200)
Fixes: OOM
Fixes: 27780/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5097985075314688
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/vividas.c

index d745770dc4de233fb315444938fe046b60c8b37e..603d01a2dc9fb3877204bb5371d075bfbf18550d 100644 (file)
@@ -267,7 +267,7 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned *size,
     *size = n;
     n -= 8;
 
-    if (avio_read(src, buf+8, n) < n) {
+    if (avio_read(src, buf+8, n) != n) {
         av_free(buf);
         return NULL;
     }