You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
dnxhdenc: fix access outside of image
This is the same test as for the 8bit case.
This commit is contained in:
committed by
James Almer
parent
74c414202f
commit
234369d0fd
@ -776,11 +776,13 @@ static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg,
|
|||||||
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
|
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
int sqsum = 0;
|
int sqsum = 0;
|
||||||
|
int bw = FFMIN(avctx->width - 16 * mb_x, 16);
|
||||||
|
int bh = FFMIN((avctx->height >> ctx->interlaced) - 16 * mb_y, 16);
|
||||||
int mean, sqmean;
|
int mean, sqmean;
|
||||||
int i, j;
|
int i, j;
|
||||||
// Macroblocks are 16x16 pixels, unlike DCT blocks which are 8x8.
|
// Macroblocks are 16x16 pixels, unlike DCT blocks which are 8x8.
|
||||||
for (i = 0; i < 16; ++i) {
|
for (i = 0; i < bh; ++i) {
|
||||||
for (j = 0; j < 16; ++j) {
|
for (j = 0; j < bw; ++j) {
|
||||||
// Turn 16-bit pixels into 10-bit ones.
|
// Turn 16-bit pixels into 10-bit ones.
|
||||||
int const sample = (unsigned) pix[j] >> 6;
|
int const sample = (unsigned) pix[j] >> 6;
|
||||||
sum += sample;
|
sum += sample;
|
||||||
|
Reference in New Issue
Block a user