diff mbox series

[FFmpeg-devel,1/3] avformat/asfdec_o: Check for EOF in asf_read_marker()

Message ID 20210119233223.21888-1-michael@niedermayer.cc
State Accepted
Commit 9e3d09f435f83f9653056b2fecc4d03ac45f3ffd
Headers show
Series [FFmpeg-devel,1/3] avformat/asfdec_o: Check for EOF in asf_read_marker()
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 19, 2021, 11:32 p.m. UTC
Fixes: Timeout
Fixes: 26460/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5710884393189376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/asfdec_o.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Jan. 24, 2021, 10:22 p.m. UTC | #1
On Wed, Jan 20, 2021 at 12:32:21AM +0100, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 26460/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5710884393189376
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/asfdec_o.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 6ce5a3fb43..3729adee2f 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -245,6 +245,9 @@  static int asf_read_marker(AVFormatContext *s, const GUIDParseTable *g)
         avio_skip(pb, 4); // flags
         len = avio_rl32(pb);
 
+        if (avio_feof(pb))
+            return AVERROR_INVALIDDATA;
+
         if ((ret = avio_get_str16le(pb, len, name,
                                     sizeof(name))) < len)
             avio_skip(pb, len - ret);