Mercurial > libavformat.hg
changeset 2763:22a672e45704 libavformat
Check for memory allocation failure of temp buffer
author | rtogni |
---|---|
date | Sun, 18 Nov 2007 22:49:41 +0000 |
parents | 137eec75e3df |
children | 7c3bad260c6a |
files | rmdec.c |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rmdec.c Sun Nov 18 22:40:02 2007 +0000 +++ b/rmdec.c Sun Nov 18 22:49:41 2007 +0000 @@ -495,7 +495,8 @@ 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;