[FFmpeg-cvslog] avcodec/gsm_parser: Replace codec_id check by assert

Michael Niedermayer git at videolan.org
Wed Aug 12 01:11:59 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Aug 12 00:16:13 2015 +0200| [542562e5abdf801f32a3fad199554428aca8083b] | committer: Michael Niedermayer

avcodec/gsm_parser: Replace codec_id check by assert

A parser should never be called with a mismatching codec

Found-by: Ganesh Ajjanagadde <gajjanag at mit.edu>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 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 9a3b94e..1054a30 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);
         }
     }
 



More information about the ffmpeg-cvslog mailing list