aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-04 01:53:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-13 02:06:35 +0100
commitfc7e3955aeae811fa1acd1348ef39f5037c60410 (patch)
treeae2745eb29f9fbf48f190b79041b7fb4c54455ac
parentacf1316167174a806c3a3cc8a36414912d9f90f4 (diff)
downloadffmpeg-fc7e3955aeae811fa1acd1348ef39f5037c60410.tar.gz
avcodec/utils: Avoid hardcoding duplicated types in sizeof()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 860d991fcd715233b5b9eb1f6c7bf0aadefb6061) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 6d6bbb7c22..77c0bf8257 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1274,7 +1274,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if (ret < 0)
return ret;
- avctx->internal = av_mallocz(sizeof(AVCodecInternal));
+ avctx->internal = av_mallocz(sizeof(*avctx->internal));
if (!avctx->internal) {
ret = AVERROR(ENOMEM);
goto end;
@@ -2766,7 +2766,7 @@ void avsubtitle_free(AVSubtitle *sub)
av_freep(&sub->rects);
- memset(sub, 0, sizeof(AVSubtitle));
+ memset(sub, 0, sizeof(*sub));
}
static int do_decode(AVCodecContext *avctx, AVPacket *pkt)