use a user-visible MACRO for max width/height.

This has been pointed as a useful information to have in the header (for
the non VP8-specs savvy ones)

Change-Id: I494b1da41dfafce882a94e3677d1cd6206bc504b
This commit is contained in:
Pascal Massimino
2011-09-12 19:27:21 +00:00
committed by James Zern
parent d4e9f5598d
commit 7a8d8762c1
2 changed files with 7 additions and 6 deletions

View File

@ -26,8 +26,6 @@ extern "C" {
#include <stdio.h>
#endif
#define MAX_DIMENSION 16384 // maximum width/height allowed by the spec
//------------------------------------------------------------------------------
int WebPGetEncoderVersion(void) {
@ -329,7 +327,7 @@ int WebPEncode(const WebPConfig* const config, WebPPicture* const pic) {
return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION);
if (pic->y == NULL || pic->u == NULL || pic->v == NULL)
return WebPEncodingSetError(pic, VP8_ENC_ERROR_NULL_PARAMETER);
if (pic->width >= MAX_DIMENSION || pic->height >= MAX_DIMENSION)
if (pic->width > WEBP_MAX_DIMENSION || pic->height > WEBP_MAX_DIMENSION)
return WebPEncodingSetError(pic, VP8_ENC_ERROR_BAD_DIMENSION);
enc = InitEncoder(config, pic);