]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix too small memory allocation
authorFlole998 <Flole998@users.noreply.github.com>
Wed, 17 Feb 2021 23:17:08 +0000 (00:17 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Feb 2021 23:17:08 +0000 (00:17 +0100)
src/transcoding/memutils.c

index d7ebca85ebc433d516f71fcdb46699cacbfd7e5e..f34eaec90dd2ca366570e74e54b9e6f40da45cff 100644 (file)
@@ -21,6 +21,7 @@
 #include "memutils.h"
 
 #include <libavutil/mem.h>
+#include <libavcodec/avcodec.h>
 
 
 static char *
@@ -107,7 +108,7 @@ str_snprintf(char *str, size_t size, const char *format, ...)
 uint8_t *
 pktbuf_copy_data(pktbuf_t *pb)
 {
-    uint8_t *data = av_malloc(pb->pb_size);
+    uint8_t *data = av_malloc(pb->pb_size + AV_INPUT_BUFFER_PADDING_SIZE);
     if (data)
         memcpy(data, pb->pb_data, pb->pb_size);
     return data;