Mercurial > libavformat.hg
comparison rmdec.c @ 2770:a7e42cf4b364 libavformat
Replace realloc with free+malloc, the previous content of the buffer is
not needed
author | rtogni |
---|---|
date | Mon, 19 Nov 2007 20:28:11 +0000 |
parents | 1d31f550e6d7 |
children | d52c718e83f9 |
comparison
equal
deleted
inserted
replaced
2769:bbdec194cf36 | 2770:a7e42cf4b364 |
---|---|
492 //now we have to deal with single slice | 492 //now we have to deal with single slice |
493 | 493 |
494 if((seq & 0x7F) == 1 || rm->curpic_num != pic_num){ | 494 if((seq & 0x7F) == 1 || rm->curpic_num != pic_num){ |
495 rm->slices = ((hdr & 0x3F) << 1) + 1; | 495 rm->slices = ((hdr & 0x3F) << 1) + 1; |
496 rm->videobufsize = len2 + 8*rm->slices + 1; | 496 rm->videobufsize = len2 + 8*rm->slices + 1; |
497 if(!(rm->videobuf = av_realloc(rm->videobuf, rm->videobufsize))) | 497 av_free(rm->videobuf); |
498 if(!(rm->videobuf = av_malloc(rm->videobufsize))) | |
498 return AVERROR(ENOMEM); | 499 return AVERROR(ENOMEM); |
499 rm->videobufpos = 8*rm->slices + 1; | 500 rm->videobufpos = 8*rm->slices + 1; |
500 rm->cur_slice = 0; | 501 rm->cur_slice = 0; |
501 rm->curpic_num = pic_num; | 502 rm->curpic_num = pic_num; |
502 rm->pktpos = url_ftell(pb); | 503 rm->pktpos = url_ftell(pb); |