aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/gsmdec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-28 00:34:52 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-11-02 14:41:16 -0400
commitbac2597a32b774db9b72163d1476673b57ea0187 (patch)
tree83308a32fc727f6d2a6a9bb75853920e2459992a /libavcodec/gsmdec.c
parentd9c6eece21dfecb510e33738092f7a43fc7d36f8 (diff)
downloadffmpeg-bac2597a32b774db9b72163d1476673b57ea0187.tar.gz
gsmdec: log error message when output buffer is too small.
also return AVERROR(EINVAL) instead of -1
Diffstat (limited to 'libavcodec/gsmdec.c')
-rw-r--r--libavcodec/gsmdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c
index 57286c796f..26340c2792 100644
--- a/libavcodec/gsmdec.c
+++ b/libavcodec/gsmdec.c
@@ -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;