mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 11:39:47 +00:00
Add check for height when cropping.
Originally committed as revision 25345 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a4d2690309
commit
93ee7f9c41
@ -49,11 +49,11 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
|
|||||||
int width = FFMIN(avctx->width ,C64XRES);
|
int width = FFMIN(avctx->width ,C64XRES);
|
||||||
uint8_t *src = p->data[0];
|
uint8_t *src = p->data[0];
|
||||||
|
|
||||||
for (blocky = 0; blocky < height; blocky += 8) {
|
for (blocky = 0; blocky < C64YRES; blocky += 8) {
|
||||||
for (blockx = 0; blockx < C64XRES; blockx += 8) {
|
for (blockx = 0; blockx < C64XRES; blockx += 8) {
|
||||||
for (y = blocky; y < blocky+8 && y < height; y++) {
|
for (y = blocky; y < blocky+8 && y < C64YRES; y++) {
|
||||||
for (x = blockx; x < blockx+8 && x < C64XRES; x += 2) {
|
for (x = blockx; x < blockx+8 && x < C64XRES; x += 2) {
|
||||||
if(x < width) {
|
if(x < width && y < height) {
|
||||||
/* build average over 2 pixels */
|
/* build average over 2 pixels */
|
||||||
luma = (src[(x + 0 + y * p->linesize[0])] +
|
luma = (src[(x + 0 + y * p->linesize[0])] +
|
||||||
src[(x + 1 + y * p->linesize[0])]) / 2;
|
src[(x + 1 + y * p->linesize[0])]) / 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user