From 542562e5abdf801f32a3fad199554428aca8083b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 12 Aug 2015 00:16:13 +0200 Subject: [PATCH] avcodec/gsm_parser: Replace codec_id check by assert A parser should never be called with a mismatching codec Found-by: Ganesh Ajjanagadde Signed-off-by: Michael Niedermayer --- libavcodec/gsm_parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/gsm_parser.c b/libavcodec/gsm_parser.c index 9a3b94ef1d8..1054a30ca91 100644 --- a/libavcodec/gsm_parser.c +++ b/libavcodec/gsm_parser.c @@ -25,6 +25,7 @@ * Splits packets into individual blocks. */ +#include "libavutil/avassert.h" #include "parser.h" #include "gsm.h" @@ -55,10 +56,7 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx, s->duration = GSM_FRAME_SIZE * 2; break; default: - *poutbuf = buf; - *poutbuf_size = buf_size; - av_log(avctx, AV_LOG_ERROR, "Invalid codec_id\n"); - return buf_size; + av_assert0(0); } } -- 2.39.5