From 4d2f83f8acb6c6444c3b276e15c5369d28b7c037 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 7 Nov 2012 17:51:59 +0100 Subject: [PATCH] gsm_parser: fix infinite loop Fixes Ticket1894 Signed-off-by: Michael Niedermayer --- libavcodec/gsm_parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/gsm_parser.c b/libavcodec/gsm_parser.c index 1d381fc109..dd26f7df11 100644 --- a/libavcodec/gsm_parser.c +++ b/libavcodec/gsm_parser.c @@ -54,7 +54,10 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx, s->duration = GSM_FRAME_SIZE * 2; break; default: - return AVERROR(EINVAL); + *poutbuf = buf; + *poutbuf_size = buf_size; + av_log(avctx, AV_LOG_ERROR, "Invalid codec_id\n"); + return buf_size; } }