aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-08-06 09:36:45 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-08-06 09:36:45 +0000
commitbf176f58b79e9bbbcc0eb243d39fda3f2419992c (patch)
treebc160c982bebab7a533b4deababe8e3c8648e54a /libavcodec
parent85fbad4555448c27e9b40b44663f5bd1dde452d2 (diff)
downloadffmpeg-bf176f58b79e9bbbcc0eb243d39fda3f2419992c.tar.gz
Deprecate avcodec_check_dimensions() in favor of the new function
av_check_image_size() declared in libavcore/imgutils.h. Originally committed as revision 24709 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h13
-rw-r--r--libavcodec/utils.c8
2 files changed, 9 insertions, 12 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a38b6307e1..9186bf52f3 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -31,7 +31,7 @@
#define LIBAVCODEC_VERSION_MAJOR 52
#define LIBAVCODEC_VERSION_MINOR 84
-#define LIBAVCODEC_VERSION_MICRO 2
+#define LIBAVCODEC_VERSION_MICRO 3
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -3392,15 +3392,14 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
int linesize_align[4]);
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
- * Check if the given dimension of a picture is valid, meaning that all
- * bytes of the picture can be addressed with a signed int.
- *
- * @param[in] w Width of the picture.
- * @param[in] h Height of the picture.
- * @return Zero if valid, a negative value if invalid.
+ * @deprecated Deprecated in favor of av_check_image_size().
*/
+attribute_deprecated
int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h);
+#endif
+
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
int avcodec_thread_init(AVCodecContext *s, int thread_count);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1d12f69db4..693b7d8f45 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -213,13 +213,11 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
*width=FFALIGN(*width, align);
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
- if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
- return 0;
-
- av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
- return AVERROR(EINVAL);
+ return av_check_image_size(w, h, 0, av_log_ctx);
}
+#endif
int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
int i;