History

avformat/mlvdec: Check avio_read()

Fixes: use-of-uninitialized-value Fixes: 383170476/clusterfuzz-testcase-minimized-ffmpeg_dem_MLV_fuzzer-4696002884337664

Michael Niedermayer committed 1 year ago

Commit bb854231 parent 53db3511 file · +4 −2Browse files

Unified · Split

libavformat/mlvdec.c+4−2
@@ -82,13 +82,15 @@ static int check_file_header(AVIOContext *pb, uint64_t guid) · 81 unmodified lines
82static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)82static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)
83{83{
84 char * value = av_malloc(size + 1);84 char * value = av_malloc(size + 1);
85 int ret;
86
85 if (!value) {87 if (!value) {
86 avio_skip(pb, size);88 avio_skip(pb, size);
87 return;89 return;
88 }90 }
89 91
90 avio_read(pb, value, size);92 ret = avio_read(pb, value, size);
91 if (!value[0]) {93 if (ret != size || !value[0]) {
92 av_free(value);94 av_free(value);
93 return;95 return;
94 }96 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t