Mercurial > libavcodec.hg
comparison utils.c @ 12371:5dffb531b1cc libavcodec
Deprecate avcodec_check_dimensions() in favor of the new function
av_check_image_size() declared in libavcore/imgutils.h.
| author | stefano |
|---|---|
| date | Fri, 06 Aug 2010 09:36:45 +0000 |
| parents | 035ca6548e29 |
| children | 914f484bb476 |
comparison
equal
deleted
inserted
replaced
| 12370:71b2c440157d | 12371:5dffb531b1cc |
|---|---|
| 211 linesize_align[2] <<= chroma_shift; | 211 linesize_align[2] <<= chroma_shift; |
| 212 align = FFMAX3(align, linesize_align[1], linesize_align[2]); | 212 align = FFMAX3(align, linesize_align[1], linesize_align[2]); |
| 213 *width=FFALIGN(*width, align); | 213 *width=FFALIGN(*width, align); |
| 214 } | 214 } |
| 215 | 215 |
| 216 #if LIBAVCODEC_VERSION_MAJOR < 53 | |
| 216 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){ | 217 int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){ |
| 217 if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8) | 218 return av_check_image_size(w, h, 0, av_log_ctx); |
| 218 return 0; | 219 } |
| 219 | 220 #endif |
| 220 av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h); | |
| 221 return AVERROR(EINVAL); | |
| 222 } | |
| 223 | 221 |
| 224 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ | 222 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ |
| 225 int i; | 223 int i; |
| 226 int w= s->width; | 224 int w= s->width; |
| 227 int h= s->height; | 225 int h= s->height; |
