mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
vp8: Check for malloc failure
Originally committed as revision 24251 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a711eb4829
commit
b6c420ce8f
@ -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->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));
|
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->macroblocks = s->macroblocks_base + 1 + s->mb_stride;
|
||||||
s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
|
s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user