gsm_parser: fix infinite loop
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Nov 2012 16:51:59 +0000 (17:51 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 7 Nov 2012 17:08:23 +0000 (18:08 +0100)
Fixes Ticket1894
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/gsm_parser.c

index 1d381fc..dd26f7d 100644 (file)
@@ -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;
         }
     }