Mercurial > libavcodec.hg
comparison truespeech.c @ 12138:41f078d6869d libavcodec
Do not try to decode less than one frame of data in TrueSpeech decoder.
This should solve issue 2085.
author | kostya |
---|---|
date | Sun, 11 Jul 2010 14:50:20 +0000 |
parents | 7dd2a45249a9 |
children |
comparison
equal
deleted
inserted
replaced
12137:b8a0924d6e42 | 12138:41f078d6869d |
---|---|
345 int iterations; | 345 int iterations; |
346 | 346 |
347 if (!buf_size) | 347 if (!buf_size) |
348 return 0; | 348 return 0; |
349 | 349 |
350 if (buf_size < 32) { | |
351 av_log(avctx, AV_LOG_ERROR, | |
352 "Too small input buffer (%d bytes), need at least 32 bytes\n", buf_size); | |
353 return -1; | |
354 } | |
350 iterations = FFMIN(buf_size / 32, *data_size / 480); | 355 iterations = FFMIN(buf_size / 32, *data_size / 480); |
351 for(j = 0; j < iterations; j++) { | 356 for(j = 0; j < iterations; j++) { |
352 truespeech_read_frame(c, buf + consumed); | 357 truespeech_read_frame(c, buf + consumed); |
353 consumed += 32; | 358 consumed += 32; |
354 | 359 |