[FFmpeg-devel] [PATCH] avcodec/gsm_parser: return -1 on parse error

chcunningham chcunningham at chromium.org
Wed Jan 30 23:27:29 EET 2019


Return replaces an assert0. libfuzzer generated a testcase that
triggered this assert (codec=0), causing a crash of chrome's renderer.
---
 libavcodec/gsm_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/gsm_parser.c b/libavcodec/gsm_parser.c
index 1054a30ca9..5cf2235f73 100644
--- a/libavcodec/gsm_parser.c
+++ b/libavcodec/gsm_parser.c
@@ -56,7 +56,7 @@ static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
             s->duration   = GSM_FRAME_SIZE * 2;
             break;
         default:
-            av_assert0(0);
+            return -1;
         }
     }
 
-- 
2.20.1.495.gaa96b0ce6b-goog



More information about the ffmpeg-devel mailing list