---
libavcodec/ra288.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index a0b86a2..4c206de 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -165,7 +165,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void
*data,
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
float *out = data;
- int i, j;
+ int i, j, out_size;
RA288Context *ractx = avctx->priv_data;
GetBitContext gb;
@@ -176,7 +176,8 @@ static int ra288_decode_frame(AVCodecContext * avctx, void
*data,
return 0;
}
- if (*data_size < 32*5*4)
+ out_size = 32 * 5 * av_get_bytes_per_sample(avctx->sample_fmt);
+ if (*data_size < out_size)
return -1;
init_get_bits(&gb, buf, avctx->block_align * 8);
@@ -199,7 +200,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void
*data,
}
}
- *data_size = (char *)out - (char *)data;
+ *data_size = out_size;
return avctx->block_align;
}
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel