From e80a3a45eed5aa4c2c7af9f165cadb2dd24db08a Mon Sep 17 00:00:00 2001 From: Piotr Bandurski Date: Wed, 10 Jul 2013 16:42:48 +0200 Subject: [PATCH] rmdec: fix a crash in case of oom --- libavformat/rmdec.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 2c4ed49..70ae809 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -722,6 +722,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, if(++vst->cur_slice > vst->slices) return 1; + if(!vst->pkt.data) + return AVERROR(ENOMEM); AV_WL32(vst->pkt.data - 7 + 8*vst->cur_slice, 1); AV_WL32(vst->pkt.data - 3 + 8*vst->cur_slice, vst->videobufpos - 8*vst->slices - 1); if(vst->videobufpos + len > vst->videobufsize) -- 1.7.9