diff --git a/libavformat/vividas.c b/libavformat/vividas.c index c0d39f0a6f..184d24f374 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -251,6 +251,9 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned *size, *key = tmpkey; } + if (n < 8) + return NULL; + buf = av_malloc(n); if (!buf) return NULL;