Browse Source

avcodec/utils: Avoid hardcoding duplicated types in sizeof()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 860d991fcd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.10
Michael Niedermayer 8 years ago
parent
commit
fc7e3955ae
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/utils.c

+ 2
- 2
libavcodec/utils.c View File

@@ -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)


Loading…
Cancel
Save