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
8282 static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)
8383 {
8484 char * value = av_malloc(size + 1);
85+ int ret;
86+
8587 if (!value) {
8688 avio_skip(pb, size);
8789 return;
8890 }
8991
90− avio_read(pb, value, size);
91− if (!value[0]) {
92+ ret = avio_read(pb, value, size);
93+ if (ret != size || !value[0]) {
9294 av_free(value);
9395 return;
9496 }

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