avformat/mlvdec: avoid uninitialized read in read_string()
Fixes: read of uninitialized memory
Fixes: 488256339/clusterfuzz-testcase-minimized-ffmpeg_dem_MLV_fuzzer-6347338118660096
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6023ad715c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -90,7 +90,7 @@ static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag
|
||||
}
|
||||
|
||||
ret = avio_read(pb, value, size);
|
||||
if (ret != size || !value[0]) {
|
||||
if (ret != size || !size || !value[0]) {
|
||||
av_free(value);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user