Skip to content

Commit 656cb04

Browse files
JiangJiasrouseabout
authored andcommitted
avcodec/vp3: Add missing check for av_malloc
Since the av_malloc() may fail and return NULL pointer, it is needed that the 's->edge_emu_buffer' should be checked whether the new allocation is success. Fixes: d147238 ("VP3: fix decoding of videos with stride > 2048") Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
1 parent cc2b320 commit 656cb04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: libavcodec/vp3.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2679,8 +2679,13 @@ static int vp3_decode_frame(AVCodecContext *avctx,
26792679
AV_GET_BUFFER_FLAG_REF)) < 0)
26802680
goto error;
26812681

2682-
if (!s->edge_emu_buffer)
2682+
if (!s->edge_emu_buffer) {
26832683
s->edge_emu_buffer = av_malloc(9 * FFABS(s->current_frame.f->linesize[0]));
2684+
if (!s->edge_emu_buffer) {
2685+
ret = AVERROR(ENOMEM);
2686+
goto error;
2687+
}
2688+
}
26842689

26852690
if (s->keyframe) {
26862691
if (!s->theora) {

0 commit comments

Comments
 (0)