diff mbox series

[FFmpeg-devel,1/8] avcodec/assdec: do not overread if zero padding is missing

Message ID 20210313213345.3268-1-cus@passwd.hu
State New
Headers show
Series [FFmpeg-devel,1/8] avcodec/assdec: do not overread if zero padding is missing
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Marton Balint March 13, 2021, 9:33 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavcodec/assdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c
index f0b1069cd2..655fc1365c 100644
--- a/libavcodec/assdec.c
+++ b/libavcodec/assdec.c
@@ -54,7 +54,7 @@  static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
         return AVERROR(ENOMEM);
     sub->num_rects = 1;
     sub->rects[0]->type = SUBTITLE_ASS;
-    sub->rects[0]->ass  = av_strdup(avpkt->data);
+    sub->rects[0]->ass  = av_strndup(avpkt->data, avpkt->size);
     if (!sub->rects[0]->ass)
         return AVERROR(ENOMEM);
     *got_sub_ptr = 1;