[FFmpeg-devel] [PATCH 2/5] avcodec/cbs_h2645: fix crash due to assert failure on empty nalu
Aman Gupta
ffmpeg at tmm1.net
Fri Oct 12 07:02:01 EEST 2018
From: Aman Gupta <aman at tmm1.net>
Signed-off-by: Aman Gupta <aman at tmm1.net>
---
libavcodec/cbs_h2645.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index ab33cdb69b..13e4c1561c 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -521,7 +521,8 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
// Remove trailing zeroes.
while (size > 0 && nal->data[size - 1] == 0)
--size;
- av_assert0(size > 0);
+ if (size == 0)
+ continue;
data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!data)
--
2.15.2 (Apple Git-101.1)
More information about the ffmpeg-devel
mailing list