summaryrefslogtreecommitdiff
path: root/libavcodec/a64multienc.c
diff options
context:
space:
mode:
authorTobias Bindhammer <tobias.bindhammer@uni-ulm.de>2010-10-05 12:14:20 +0000
committerTobias Bindhammer <tobias.bindhammer@uni-ulm.de>2010-10-05 12:14:20 +0000
commit93ee7f9c41c4083c49cd031b6325dd92e0b21b84 (patch)
treeb5ad02938bdc10143328cb126e3e2c92d98e1709 /libavcodec/a64multienc.c
parenta4d269030976e04d9db0ae9e9c0ed21865048936 (diff)
Add check for height when cropping.
Originally committed as revision 25345 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/a64multienc.c')
-rw-r--r--libavcodec/a64multienc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c
index 6b3d79787b..f6d4c1ecd5 100644
--- a/libavcodec/a64multienc.c
+++ b/libavcodec/a64multienc.c
@@ -49,11 +49,11 @@ static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
int width = FFMIN(avctx->width ,C64XRES);
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 (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) {
- if(x < width) {
+ if(x < width && y < height) {
/* build average over 2 pixels */
luma = (src[(x + 0 + y * p->linesize[0])] +
src[(x + 1 + y * p->linesize[0])]) / 2;