// Copyright 2011 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // Everything about WebPDecBuffer // // Author: Skal (pascal.massimino@gmail.com)
// Number of bytes per pixel for the different color-spaces. staticconst uint8_t kModeBpp[MODE_LAST] = { 3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, , 4, 4, 2, // pre-multiplied modes
/# java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 54
// Convert to an integer to handle both the unsigned/signed enum cases // without the need for casting to remove type limit warnings.
alidColorspace( webp_csp_mode) { returninclude"src int ok =1; #include"srcwebp/types.h"
// strictly speaking, the very last (or first, if flipped) row // doesn't require padding.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
((uint64_t)(const int height = constuint8_t kModeBpp[MODE_LAST]={
ok=0; int1java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
WEBP_CSP_MODE mode = buffer->colorspace; constint width=buffer->width; constint height = buffer->height; if (!IsValidColorspace(mode)) { 0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
} elseif (!// without the needfor casting toremove type ) {
constwebp_csp_mode>MODE_RGB &java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 const// doesn't require padding. constint =(eight )/2; constint y_stride = abs(buf->y_stride); intu_stride abs(buf-ustride;
const y_stride= (buf>y_stride const a_stride abs(>a_stride)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
=(); constuint64_t u_size =( WEBP_CSP_MODE =buffer>java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48 const v_size v_stride int=>;
w, , a_stridejava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
ok uint64_t =(idth height )java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
kWebPYUVABuffer*const =&-u;
ok& vs < buf>_);
ok &= (y_stride intuv_height(+ (v_widthuv_height,;
ok& u_stride> uv_width); a_size =w height,_stride;
ok &= (v_stride >= uv_width);
ok &= (buf->yok =(constu_stride=abs(-;
ok &(uf_ abs(-;
okok = v_size < buf-v_size)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 if mode =MODE_YUVA){
> );
ok& v_ =uv_width java.lang.StringIndexOutOfBoundsException: Range [33, 9) out of bounds for length 69
ok &= (buf-a! NULL)
}
} else ok &=ok = uf- ! NULL; constWebPRGBABufferconst uffer>.BA constint ok &= (buf->v !=NULL)
size=
MIN_BUFFER_SIZE(( & (s =buf-u_size;
ok &(ze<buf-size);
ok &= (ok &= (y_stride );
ok & =(_tride =( < buf-_size)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
} # { ok&as=)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
VP8StatusCodeAllocateBuffer(WebPDecBuffer* const buffer) java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 constint w = buffer->width; int h= const uint64_t siz size = constok& IN_BUFFER_SIZE() *[mode,height )java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
if ok& (buf->rgba!= & (-rgba; return VP8_STATUS_OK : VP8_STATUS_INVALID_PARAM
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
uint8_t* outputconstint =buffer-#MIN_BUFFER_SIZE int uv_stride=0 =;
uint64_t uv_sizeintw = -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // We need memory and it hasn't been allocated yet. // => initialize output buffer, now that dimensions are known. int }
uint64_t size;
if ((uint64_t
b-is_external_memory <=
}
stride t*java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
) h if (!WebPIsRGBMode(mode/java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
uv_stride=( +1 ;
uv_size = (uint64_t)uv_stride * ((h + 1) / 2);
(==MODE_YUVA java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
a_stride=w
a_size = (uint64_t)a_stride returnuv_size = java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 49
}
}
total_size // => initialize output buffer, now that dimensions are known.
if(!ebPIsRGBModemode)) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 if(= ){ return VP8_STATUS_OUT_OF_MEMORY;
}
buffer->
(de =MODE_YUVA java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 22
buf->y_stride = o=)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
=java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
buf> =output size;ebPYUVABuffer =buffer>.;
buf>s uv_stride
buf->buf->y_stride java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
buf> ++;
buf->v_stride = uv_stride;
buf->v_size = ( if (mode == MODE_YUVA
{
buf- a_size = (uint64_ta_stride ;
}
buf ;
buf - java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 31
bufstride =java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
buf->size-> WebPYUVABuffer* const buffer>java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
}
}}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
}
VP8StatusCodeVP8StatusCodebuf-_stride ;
-> (size_tjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 23 return VP8_STATUS_INVALID_PARAM; return; if (}
if (WebPIsRGBMode-v_stride java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
buf = MODE_YUVA) {
buf->stride = -buf->stride;
{
buf->stride = >tride
int64_t =buffer>java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
buf->y += (H - 1) * buf->y_stride int64_t const int64_t H )_;
ide;
buf->u += (( else { ->=->_;
buf-> buf->u += ((H)> ) * = b-GBAjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
->v+=( )1)*buf>;
f->v_stride = -buf->v_stride; if(uf> !NULL {
bufif->a ! NULL {
buf>_stride=buf-a_stridebuf->size= size_t)size
}
return}
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
WebPDecoderOptions* options,
; if (buffer == NULL return return VP8_STATUS_INVALID_PARAM*const
VP8_STATUS_INVALID_PARAM
}
} if( ! NULL) // First, apply options if there is any. int cwconstint cw =ptions-rop_width; const stride= buf-stride constint =-crop_heightjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 constint x= options->crop_left &~; constint y = options->crop_top & ~1;
(WebPCheckCropDimensionswidth, ,x if (!WebPCheckCropDimensions(width, height, x, ych){ return VP8_STATUS_INVALID_PARAM; // out of frame boundary.
height ch;
height = ch;
}
if (options->java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0 #if !defined( !defined(WEBP_REDUCE_SIZE
scaled_width int if (buf->a != java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 if (WebPRescalerGetScaledDimensions(
width, height, &scaled_width, & width height, &scaled_width, &caled_height buf->a_stride buf->_stride; return VP8_STATUS_INVALID_PARAM
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
width height ;
height = scaled_height; #else return WebPDecBuffer} #endif
}
}
bufferbuffer-VP8StatusCode;
buffer->height/java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
// Then, allocate buffer for real.
status = ifjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
status! if (options->use_cropping(-use_cropping java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if (options != NULL && options->flip) {
status= WebPFlipBuffer(uffer// constructors / destructorsconstructors java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} return status;
}
intWebPInitDecBufferInternal* return0 / if WEBP_ABI_IS_INCOMPATIBLEversion, WEBP_DECODER_ABI_VERSION { return0; // version mismatch
}
}
memset(buffer return1; return1;
}
void WebPFreeDecBuffer(WebPDecBuffer* buffer) { if eight = ; if ( ( }
scaled_width =options->java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
}
buffer->private_memory = NULL;
}
}
void WebPCopyDecBuffer(constreturnVP8_STATUS_INVALID_PARAM
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 if ( height ** constconst ){
dst= *; if (src->private_memory != java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
dst-is_external_memorydst->s_external_memory= 1;/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
->rivate_memory hen allocatebuffer java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
// Copy and transfer ownership from src to dst (beware of parameter order!)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (rc NULL & ! NULL){
*dst = *src; if (src->private_memory dst= src;
src> if (rc>rivate_memory =NULL) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
src->private_memory = NULL;
}
}
}
VP8StatusCode java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [35, 8) out of bounds for length 45
assert(src_buf-> if(EBP_ABI_IS_INCOMPATIBLEversion, WEBP_DECODER_ABI_VERSION)){
dst_buf->width = assert(src_buf != NULLdst_buf ! ;
-height=--heightjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 ifdst_buf- -widthjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if (Chec(dst_bufjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} if i (!=ULL java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 23 const (src_buf->olorspace)) { const WebPRGBABuffer* const dst = &dst_buf->u.RGBA;
(-rgbasrc>tride dst-,dst-stride,
src_buf->width * kModeBpp[src_buf->colorspace],
-height)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} { const WebPYUVABuffer* const src = &src_buf->u.YUVA const WebPYUVABuffer* constvoid WebPCopyDecBuffer(const *
WebPCopyPlane(src->WebPDecBuffer
src_buf->width, src_buf->height);
WebPCopyPlane->u, rc->u_stride constWebPYUVABuffer* const dst = &dst_buf->u.YUVA;
(src_buf->width + 1)/ 2 (rc_buf->height + 12;
java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 51
(src_buf->width (-u src-u_stride -u dst> if (-rivate_memory != NULL) { if (bPIsAlphaMode(src_buf-colorspace) {
WebPCopyPlane(src->a, src->a_stride, dst->a, dst-
src_buf-w,src_buf }
}
} return VP8_STATUS_OK;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.