aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Togni <r_togni@tiscali.it>2007-11-18 22:49:41 +0000
committerRoberto Togni <r_togni@tiscali.it>2007-11-18 22:49:41 +0000
commit52537534d20c675d3c53cdad160dd3462fbfef30 (patch)
tree7361e1aea3fb65445a9ee7051f44642ca0301fe2
parente11d0145e29c38a2721fe131728d83512e5c30b9 (diff)
downloadffmpeg-52537534d20c675d3c53cdad160dd3462fbfef30.tar.gz
Check for memory allocation failure of temp buffer
Originally committed as revision 11053 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rmdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 8793487dd9..4fef4cd8ec 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -495,7 +495,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *
if((seq & 0x7F) == 1 || rm->curpic_num != pic_num){
rm->slices = ((hdr & 0x3F) << 1) + 1;
ssize = len2 + 8*rm->slices + 1;
- rm->videobuf = av_realloc(rm->videobuf, ssize);
+ if(!(rm->videobuf = av_realloc(rm->videobuf, ssize)))
+ return AVERROR(ENOMEM);
rm->videobufsize = ssize;
rm->videobufpos = 8*rm->slices + 1;
rm->cur_slice = 0;