diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 4cc4a34df0..79623094d6 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -494,7 +494,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; rm->videobufsize = len2 + 8*rm->slices + 1; - if(!(rm->videobuf = av_realloc(rm->videobuf, rm->videobufsize))) + av_free(rm->videobuf); + if(!(rm->videobuf = av_malloc(rm->videobufsize))) return AVERROR(ENOMEM); rm->videobufpos = 8*rm->slices + 1; rm->cur_slice = 0;