avcodec/gsm_parser: Replace codec_id check by assert

A parser should never be called with a mismatching codec

Found-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-08-12 00:16:13 +02:00
parent 107e54c5bf
commit 542562e5ab

View File

@ -25,6 +25,7 @@
* Splits packets into individual blocks. * Splits packets into individual blocks.
*/ */
#include "libavutil/avassert.h"
#include "parser.h" #include "parser.h"
#include "gsm.h" #include "gsm.h"
@ -55,10 +56,7 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
s->duration = GSM_FRAME_SIZE * 2; s->duration = GSM_FRAME_SIZE * 2;
break; break;
default: default:
*poutbuf = buf; av_assert0(0);
*poutbuf_size = buf_size;
av_log(avctx, AV_LOG_ERROR, "Invalid codec_id\n");
return buf_size;
} }
} }