[FFmpeg-cvslog] gsm_parser: fix infinite loop

Michael Niedermayer git at videolan.org
Wed Nov 7 18:08:47 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov  7 17:51:59 2012 +0100| [4d2f83f8acb6c6444c3b276e15c5369d28b7c037] | committer: Michael Niedermayer

gsm_parser: fix infinite loop

Fixes Ticket1894
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d2f83f8acb6c6444c3b276e15c5369d28b7c037
---

 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 1d381fc..dd26f7d 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;
         }
     }
 



More information about the ffmpeg-cvslog mailing list