comparison mpegaudiodec.c @ 6688:91f5a23d6cd5 libavcodec

return error if buf_size is too small
author bcoudurier
date Sat, 26 Apr 2008 12:39:45 +0000
parents 798391f1ce13
children 85cb0c3f8e54
comparison
equal deleted inserted replaced
6687:798391f1ce13 6688:91f5a23d6cd5
2568 int off = avctx->channels; 2568 int off = avctx->channels;
2569 const uint8_t *coff = chan_offset[s->chan_cfg]; 2569 const uint8_t *coff = chan_offset[s->chan_cfg];
2570 2570
2571 len = buf_size; 2571 len = buf_size;
2572 2572
2573 *data_size = 0;
2573 // Discard too short frames 2574 // Discard too short frames
2574 if (buf_size < HEADER_SIZE) { 2575 if (buf_size < HEADER_SIZE)
2575 *data_size = 0; 2576 return -1;
2576 return buf_size;
2577 }
2578 2577
2579 // If only one decoder interleave is not needed 2578 // If only one decoder interleave is not needed
2580 outptr = s->frames == 1 ? out_samples : decoded_buf; 2579 outptr = s->frames == 1 ? out_samples : decoded_buf;
2581 2580
2582 for (fr = 0; fr < s->frames; fr++) { 2581 for (fr = 0; fr < s->frames; fr++) {