]> git.sesse.net Git - ffmpeg/commitdiff
gsm: log error message when packet is too small
authorJustin Ruggles <justin.ruggles@gmail.com>
Fri, 28 Oct 2011 14:18:07 +0000 (10:18 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Wed, 2 Nov 2011 18:41:17 +0000 (14:41 -0400)
libavcodec/gsmdec.c
libavcodec/libgsm.c

index f084b145537be9ab3e87a420c7b0bcc2f88247f2..1091745f4bda62cc9619cbff02200fe2790ebba5 100644 (file)
@@ -66,8 +66,10 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
         return AVERROR(EINVAL);
     }
 
-    if(buf_size < avctx->block_align)
+    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:
index 790eacd6ddfc3a821a2fe90b4ceeb1911cee52ff..1b12ca45e68c703d5fee0fa12ddfe484ad65bd33 100644 (file)
@@ -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;