1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

gsmdec: log error message when output buffer is too small.

also return AVERROR(EINVAL) instead of -1
This commit is contained in:
Justin Ruggles 2011-10-28 00:34:52 -04:00
parent d9c6eece21
commit bac2597a32

View File

@ -61,8 +61,10 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
int frame_bytes = avctx->frame_size * int frame_bytes = avctx->frame_size *
av_get_bytes_per_sample(avctx->sample_fmt); av_get_bytes_per_sample(avctx->sample_fmt);
if (*data_size < frame_bytes) if (*data_size < frame_bytes) {
return -1; av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n");
return AVERROR(EINVAL);
}
*data_size = 0; *data_size = 0;
if(buf_size < avctx->block_align) if(buf_size < avctx->block_align)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;