diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-28 10:18:07 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-02 14:41:17 -0400 |
commit | 9d52f0a7113d9ce14e038f8e65fd0e92ce0d33c1 (patch) | |
tree | f1c251ecb8fee95c1d7ef9164ad8279654b0a2c9 /libavcodec/libgsm.c | |
parent | 9671db824565658154b638c97cfd3a9733117400 (diff) | |
download | ffmpeg-9d52f0a7113d9ce14e038f8e65fd0e92ce0d33c1.tar.gz |
gsm: log error message when packet is too small
Diffstat (limited to 'libavcodec/libgsm.c')
-rw-r--r-- | libavcodec/libgsm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 790eacd6dd..1b12ca45e6 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -175,7 +175,11 @@ static int libgsm_decode_frame(AVCodecContext *avctx, return AVERROR(EINVAL); } - if(buf_size < avctx->block_align) return -1; + if (buf_size < avctx->block_align) { + av_log(avctx, AV_LOG_ERROR, "Packet is too small\n"); + return AVERROR_INVALIDDATA; + } + switch(avctx->codec_id) { case CODEC_ID_GSM: if(gsm_decode(avctx->priv_data,buf,data)) return -1; |