Mercurial > libavcodec.hg
comparison ra144.c @ 7506:e94202a2e0b6 libavcodec
Check available size before writing in decode_frame()
author | vitor |
---|---|
date | Wed, 06 Aug 2008 05:06:10 +0000 |
parents | 85ab7655ad4d |
children | 8f89a4d76a71 |
comparison
equal
deleted
inserted
replaced
7505:2c22852d1998 | 7506:e94202a2e0b6 |
---|---|
312 int16_t *data = vdata; | 312 int16_t *data = vdata; |
313 unsigned int energy; | 313 unsigned int energy; |
314 | 314 |
315 RA144Context *ractx = avctx->priv_data; | 315 RA144Context *ractx = avctx->priv_data; |
316 GetBitContext gb; | 316 GetBitContext gb; |
317 | |
318 if (*data_size < 2*160) | |
319 return -1; | |
317 | 320 |
318 if(buf_size < 20) { | 321 if(buf_size < 20) { |
319 av_log(avctx, AV_LOG_ERROR, | 322 av_log(avctx, AV_LOG_ERROR, |
320 "Frame too small (%d bytes). Truncated file?\n", buf_size); | 323 "Frame too small (%d bytes). Truncated file?\n", buf_size); |
321 *data_size = 0; | 324 *data_size = 0; |