avcodec/mpegvideo_enc: Fix 1 line and one column images

Fixes: Ticket10952
Fixes: poc21ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-04-08 18:38:42 +02:00
parent a3bb269db9
commit 96449cfeae
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 2 deletions

View File

@ -1198,8 +1198,8 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
ptrdiff_t dst_stride = i ? s->uvlinesize : s->linesize; ptrdiff_t dst_stride = i ? s->uvlinesize : s->linesize;
int h_shift = i ? s->chroma_x_shift : 0; int h_shift = i ? s->chroma_x_shift : 0;
int v_shift = i ? s->chroma_y_shift : 0; int v_shift = i ? s->chroma_y_shift : 0;
int w = s->width >> h_shift; int w = AV_CEIL_RSHIFT(s->width , h_shift);
int h = s->height >> v_shift; int h = AV_CEIL_RSHIFT(s->height, v_shift);
const uint8_t *src = pic_arg->data[i]; const uint8_t *src = pic_arg->data[i];
uint8_t *dst = pic->f->data[i]; uint8_t *dst = pic->f->data[i];
int vpad = 16; int vpad = 16;