git.videolan.org
/
ffmpeg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avcodec/fmvc: Check nb_blocks
[ffmpeg.git]
/
libavcodec
/
fmvc.c
diff --git
a/libavcodec/fmvc.c
b/libavcodec/fmvc.c
index
1f8b0c5
..
ff5f291
100644
(file)
--- a/
libavcodec/fmvc.c
+++ b/
libavcodec/fmvc.c
@@
-561,6
+561,9
@@
static av_cold int decode_init(AVCodecContext *avctx)
}
s->nb_blocks = s->xb * s->yb;
}
s->nb_blocks = s->xb * s->yb;
+ if (!s->nb_blocks)
+ return AVERROR_INVALIDDATA;
+
s->blocks = av_calloc(s->nb_blocks, sizeof(*s->blocks));
if (!s->blocks)
return AVERROR(ENOMEM);
s->blocks = av_calloc(s->nb_blocks, sizeof(*s->blocks));
if (!s->blocks)
return AVERROR(ENOMEM);