aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorPiotr Bandurski <ami_stuff@o2.pl>2013-07-10 17:14:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-12 04:24:35 +0200
commit161047f010b1d9dbc153a71c1ee75dc2a34561de (patch)
treec11d2063c808a994f1c4487f2ce3def651c01a68 /libavformat/rmdec.c
parent38ce775eead70b84272ee4ba908b6db3516e7cbd (diff)
downloadffmpeg-161047f010b1d9dbc153a71c1ee75dc2a34561de.tar.gz
rmdec: fix crash in case of oom
Fixes ticket #2724 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 2c4ed49c12..70ae8099e9 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)