diff mbox series

[FFmpeg-devel,1/2] avcodec/videotoolboxenc: fix align issue

Message ID tencent_609A679FA9AB3A4E5670732D689A7A405008@qq.com
State Accepted
Commit 419d2524a8239a8f00b4c1702c91065b259615a2
Headers show
Series [FFmpeg-devel,1/2] avcodec/videotoolboxenc: fix align issue
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

zhilizhao(赵志立) Aug. 26, 2020, 9:38 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

bool a53_cc is accessed as int:
src/libavutil/opt.c:129:9: runtime error: store to misaligned
address 0x7fbf454121a3 for type 'int', which requires 4 byte alignment
---
 libavcodec/videotoolboxenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

zhilizhao(赵志立) Sept. 26, 2020, 4:32 p.m. UTC | #1
Ping for the patch set.

> On Aug 27, 2020, at 5:38 AM, quinkblack@foxmail.com wrote:
> 
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> bool a53_cc is accessed as int:
> src/libavutil/opt.c:129:9: runtime error: store to misaligned
> address 0x7fbf454121a3 for type 'int', which requires 4 byte alignment
> ---
> libavcodec/videotoolboxenc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index e89cfaeed8..988782f10d 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -226,7 +226,9 @@ typedef struct VTEncContext {
>     bool flushing;
>     bool has_b_frames;
>     bool warned_color_range;
> -    bool a53_cc;
> +
> +    /* can't be bool type since AVOption will access it as int */
> +    int a53_cc;
> } VTEncContext;
> 
> static int vtenc_populate_extradata(AVCodecContext   *avctx,
> -- 
> 2.28.0
>
diff mbox series

Patch

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index e89cfaeed8..988782f10d 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -226,7 +226,9 @@  typedef struct VTEncContext {
     bool flushing;
     bool has_b_frames;
     bool warned_color_range;
-    bool a53_cc;
+
+    /* can't be bool type since AVOption will access it as int */
+    int a53_cc;
 } VTEncContext;
 
 static int vtenc_populate_extradata(AVCodecContext   *avctx,