Browse Source

gsm: log error message when packet is too small

tags/n0.9
Justin Ruggles 13 years ago
parent
commit
9d52f0a711
2 changed files with 8 additions and 2 deletions
  1. +3
    -1
      libavcodec/gsmdec.c
  2. +5
    -1
      libavcodec/libgsm.c

+ 3
- 1
libavcodec/gsmdec.c View 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:


+ 5
- 1
libavcodec/libgsm.c View 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;


Loading…
Cancel
Save