Message ID | 20210207205003.29446-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | cb90e1c4d03414b9abc765ab0b91d87a9278fb73 |
Headers | show |
Series | [FFmpeg-devel,1/2] avformat/mov: sanity check STSD entries | expand |
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 |
On Sun, Feb 07, 2021 at 09:50:02PM +0100, Michael Niedermayer wrote: > The choosen value is arbitrary. I am not sure if this is a good idea > but i dont immedeately see an alternative better way, it seems either > an arbitrary limit or OOM > > Fixes: OOM > Fixes: 27492/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6194970578649088 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/mov.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply [...]
diff --git a/libavformat/mov.c b/libavformat/mov.c index d9a6a54083..0c44032071 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2605,7 +2605,7 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) entries = avio_rb32(pb); /* Each entry contains a size (4 bytes) and format (4 bytes). */ - if (entries <= 0 || entries > atom.size / 8) { + if (entries <= 0 || entries > atom.size / 8 || entries > 1024) { av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries); return AVERROR_INVALIDDATA; }
The choosen value is arbitrary. I am not sure if this is a good idea but i dont immedeately see an alternative better way, it seems either an arbitrary limit or OOM Fixes: OOM Fixes: 27492/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6194970578649088 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)