Skip to content

Commit

Permalink
check return value from avcodec_alloc_context3
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@2963 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 14, 2013
1 parent aa1030c commit cb20b0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/xpra/x264/x264lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ int init_decoder_context(struct x264lib_ctx *ctx, int width, int height, int csc
return 1;
}
ctx->codec_ctx = avcodec_alloc_context3(ctx->codec);
if (!ctx->codec_ctx) {
fprintf(stderr, "failed to allocate codec context!\n");
return 1;
}
ctx->codec_ctx->width = ctx->width;
ctx->codec_ctx->height = ctx->height;
ctx->codec_ctx->pix_fmt = csc_fmt;
Expand Down

0 comments on commit cb20b0f

Please sign in to comment.