Commit 0f7af066 authored by Benjamin Larsson's avatar Benjamin Larsson

The block_size might be used incorrectly if it is not updated.

Originally committed as revision 7607 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5c1844ab
...@@ -135,12 +135,12 @@ static int flashsv_decode_frame(AVCodecContext *avctx, ...@@ -135,12 +135,12 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
if(s->block_size < s->block_width*s->block_height) { if(s->block_size < s->block_width*s->block_height) {
if (s->tmpblock != NULL) if (s->tmpblock != NULL)
av_free(s->tmpblock); av_free(s->tmpblock);
s->block_size = s->block_width*s->block_height; if ((s->tmpblock = av_malloc(3*s->block_width*s->block_height)) == NULL) {
if ((s->tmpblock = av_malloc(3*s->block_size)) == NULL) {
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n"); av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
return -1; return -1;
} }
} }
s->block_size = s->block_width*s->block_height;
/* init the image size once */ /* init the image size once */
if((avctx->width==0) && (avctx->height==0)){ if((avctx->width==0) && (avctx->height==0)){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment