You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
Merge commit 'aa0dd52434768da64f1f3d8ae92bcf980c1adffc'
* commit 'aa0dd52434768da64f1f3d8ae92bcf980c1adffc': xxan: Disallow odd width See:77693c541a
See:8ad9b48c9b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -52,6 +52,10 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_ERROR, "Invalid frame height: %d.\n", avctx->height);
|
av_log(avctx, AV_LOG_ERROR, "Invalid frame height: %d.\n", avctx->height);
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
if (avctx->width & 1) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid frame width: %d.\n", avctx->width);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
s->buffer_size = avctx->width * avctx->height;
|
s->buffer_size = avctx->width * avctx->height;
|
||||||
s->y_buffer = av_malloc(s->buffer_size);
|
s->y_buffer = av_malloc(s->buffer_size);
|
||||||
@@ -300,7 +304,6 @@ static int xan_decode_frame_type0(AVCodecContext *avctx)
|
|||||||
ybuf[j+1] = cur << 1;
|
ybuf[j+1] = cur << 1;
|
||||||
last = cur;
|
last = cur;
|
||||||
}
|
}
|
||||||
if(j < avctx->width)
|
|
||||||
ybuf[j] = last << 1;
|
ybuf[j] = last << 1;
|
||||||
prev_buf = ybuf;
|
prev_buf = ybuf;
|
||||||
ybuf += avctx->width;
|
ybuf += avctx->width;
|
||||||
@@ -314,7 +317,6 @@ static int xan_decode_frame_type0(AVCodecContext *avctx)
|
|||||||
ybuf[j+1] = cur << 1;
|
ybuf[j+1] = cur << 1;
|
||||||
last = cur;
|
last = cur;
|
||||||
}
|
}
|
||||||
if(j < avctx->width)
|
|
||||||
ybuf[j] = last << 1;
|
ybuf[j] = last << 1;
|
||||||
prev_buf = ybuf;
|
prev_buf = ybuf;
|
||||||
ybuf += avctx->width;
|
ybuf += avctx->width;
|
||||||
@@ -375,7 +377,6 @@ static int xan_decode_frame_type1(AVCodecContext *avctx)
|
|||||||
ybuf[j+1] = cur;
|
ybuf[j+1] = cur;
|
||||||
last = cur;
|
last = cur;
|
||||||
}
|
}
|
||||||
if(j < avctx->width)
|
|
||||||
ybuf[j] = last;
|
ybuf[j] = last;
|
||||||
ybuf += avctx->width;
|
ybuf += avctx->width;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user