You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/rv34: Add check for av_malloc
Add the check for the return value of the av_malloc in order to avoid
NULL pointer deference.
Fixes: b86ab38137
("Add weighted motion compensation for RV40 B-frames")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
This commit is contained in:
committed by
James Almer
parent
a3f49168dc
commit
f8d0b13de5
@@ -1692,6 +1692,8 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *pict,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
r->tmp_b_block_base = av_malloc(s->linesize * 48);
|
r->tmp_b_block_base = av_malloc(s->linesize * 48);
|
||||||
|
if (!r->tmp_b_block_base)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
r->tmp_b_block_y[i] = r->tmp_b_block_base
|
r->tmp_b_block_y[i] = r->tmp_b_block_base
|
||||||
+ i * 16 * s->linesize;
|
+ i * 16 * s->linesize;
|
||||||
|
Reference in New Issue
Block a user