Commit bac2597a authored by Justin Ruggles's avatar Justin Ruggles

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

also return AVERROR(EINVAL) instead of -1
parent d9c6eece
......@@ -61,8 +61,10 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
int frame_bytes = avctx->frame_size *
av_get_bytes_per_sample(avctx->sample_fmt);
if (*data_size < frame_bytes)
return -1;
if (*data_size < frame_bytes) {
av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n");
return AVERROR(EINVAL);
}
*data_size = 0;
if(buf_size < avctx->block_align)
return AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment