Mercurial > libavcodec.hg
comparison imgresample.c @ 5186:8a6fac216a2f libavcodec
test context before accessing it
| author | benoit |
|---|---|
| date | Tue, 26 Jun 2007 18:00:50 +0000 |
| parents | a81dc8cc24fa |
| children | 9968f39d03aa |
comparison
equal
deleted
inserted
replaced
| 5185:a81dc8cc24fa | 5186:8a6fac216a2f |
|---|---|
| 641 SwsFilter *dstFilter, double *param) | 641 SwsFilter *dstFilter, double *param) |
| 642 { | 642 { |
| 643 struct SwsContext *ctx; | 643 struct SwsContext *ctx; |
| 644 | 644 |
| 645 ctx = av_malloc(sizeof(struct SwsContext)); | 645 ctx = av_malloc(sizeof(struct SwsContext)); |
| 646 if (ctx) | |
| 646 ctx->av_class = av_mallocz(sizeof(AVClass)); | 647 ctx->av_class = av_mallocz(sizeof(AVClass)); |
| 647 if (!ctx || !ctx->av_class) { | 648 if (!ctx || !ctx->av_class) { |
| 648 av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n"); | 649 av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n"); |
| 649 | 650 |
| 650 return NULL; | 651 return NULL; |
