Mercurial > libavcodec.hg
comparison tiff.c @ 12372:914f484bb476 libavcodec
Remove use of the deprecated function avcodec_check_dimensions(), use
av_check_image_size() instead.
author | stefano |
---|---|
date | Fri, 06 Aug 2010 09:37:04 +0000 |
parents | 7dd2a45249a9 |
children | ffb3668ff7af |
comparison
equal
deleted
inserted
replaced
12371:5dffb531b1cc | 12372:914f484bb476 |
---|---|
31 #include "lzw.h" | 31 #include "lzw.h" |
32 #include "tiff.h" | 32 #include "tiff.h" |
33 #include "faxcompr.h" | 33 #include "faxcompr.h" |
34 #include "libavutil/common.h" | 34 #include "libavutil/common.h" |
35 #include "libavutil/intreadwrite.h" | 35 #include "libavutil/intreadwrite.h" |
36 #include "libavcore/imgutils.h" | |
36 | 37 |
37 typedef struct TiffContext { | 38 typedef struct TiffContext { |
38 AVCodecContext *avctx; | 39 AVCodecContext *avctx; |
39 AVFrame picture; | 40 AVFrame picture; |
40 | 41 |
303 default: | 304 default: |
304 av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count); | 305 av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count); |
305 return -1; | 306 return -1; |
306 } | 307 } |
307 if(s->width != s->avctx->width || s->height != s->avctx->height){ | 308 if(s->width != s->avctx->width || s->height != s->avctx->height){ |
308 if(avcodec_check_dimensions(s->avctx, s->width, s->height)) | 309 if(av_check_image_size(s->width, s->height, 0, s->avctx)) |
309 return -1; | 310 return -1; |
310 avcodec_set_dimensions(s->avctx, s->width, s->height); | 311 avcodec_set_dimensions(s->avctx, s->width, s->height); |
311 } | 312 } |
312 if(s->picture.data[0]) | 313 if(s->picture.data[0]) |
313 s->avctx->release_buffer(s->avctx, &s->picture); | 314 s->avctx->release_buffer(s->avctx, &s->picture); |
505 /* now we have the data and may start decoding */ | 506 /* now we have the data and may start decoding */ |
506 if(!p->data[0]){ | 507 if(!p->data[0]){ |
507 s->bpp = 1; | 508 s->bpp = 1; |
508 avctx->pix_fmt = PIX_FMT_MONOBLACK; | 509 avctx->pix_fmt = PIX_FMT_MONOBLACK; |
509 if(s->width != s->avctx->width || s->height != s->avctx->height){ | 510 if(s->width != s->avctx->width || s->height != s->avctx->height){ |
510 if(avcodec_check_dimensions(s->avctx, s->width, s->height)) | 511 if(av_check_image_size(s->width, s->height, 0, s->avctx)) |
511 return -1; | 512 return -1; |
512 avcodec_set_dimensions(s->avctx, s->width, s->height); | 513 avcodec_set_dimensions(s->avctx, s->width, s->height); |
513 } | 514 } |
514 if(s->picture.data[0]) | 515 if(s->picture.data[0]) |
515 s->avctx->release_buffer(s->avctx, &s->picture); | 516 s->avctx->release_buffer(s->avctx, &s->picture); |