aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp8.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-07-16 07:20:31 +0000
committerDavid Conrad <lessen42@gmail.com>2010-07-16 07:20:31 +0000
commitb6c420ce8f1151121350892c75e8d688e085f253 (patch)
treef5b2dbbbb1f6577894a349e549f418f7abaf97ae /libavcodec/vp8.c
parenta711eb48295dfa6c8556bbd7aa55e7cc4d0e19d6 (diff)
downloadffmpeg-b6c420ce8f1151121350892c75e8d688e085f253.tar.gz
vp8: Check for malloc failure
Originally committed as revision 24251 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r--libavcodec/vp8.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 74a05f3310..85f1723ae9 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -225,6 +225,9 @@ static int update_dimensions(VP8Context *s, int width, int height)
s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
+ if (!s->macroblocks_base || !s->intra4x4_pred_mode_base || !s->top_nnz)
+ return AVERROR(ENOMEM);
+
s->macroblocks = s->macroblocks_base + 1 + s->mb_stride;
s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;