History

avcodec/lead: support unaligned blocks

Fixed ticket #10656.

Peter Ross committed 3 years ago

Commit db975ff1 parent 80131321 file · +4 −4Browse files

Unified · Split

libavcodec/leaddec.c+4−4
@@ -195,8 +195,8 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame, · 194 unmodified lines
195 init_get_bits8(&gb, s->bitstream_buf, size);195 init_get_bits8(&gb, s->bitstream_buf, size);
196 196
197 if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {197 if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
198 for (int mb_y = 0; mb_y < avctx->height / 16; mb_y++)198 for (int mb_y = 0; mb_y < (avctx->height + 15) / 16; mb_y++)
199 for (int mb_x = 0; mb_x < avctx->width / 16; mb_x++)199 for (int mb_x = 0; mb_x < (avctx->width + 15) / 16; mb_x++)
200 for (int b = 0; b < (yuv20p_half ? 4 : 6); b++) {200 for (int b = 0; b < (yuv20p_half ? 4 : 6); b++) {
201 int luma_block = yuv20p_half ? 2 : 4;201 int luma_block = yuv20p_half ? 2 : 4;
202 const VLCElem * dc_vlc = b < luma_block ? luma_dc_vlc : chroma_dc_vlc;202 const VLCElem * dc_vlc = b < luma_block ? luma_dc_vlc : chroma_dc_vlc;
@@ -228,8 +228,8 @@ static int lead_decode_frame(AVCodecContext *avctx, AVFrame * frame, · 25 unmodified lines
228 }228 }
229 } else {229 } else {
230 for (int f = 0; f < fields; f++)230 for (int f = 0; f < fields; f++)
231 for (int j = 0; j < avctx->height / fields / 8; j++)231 for (int j = 0; j < (avctx->height + 7) / fields / 8; j++)
232 for (int i = 0; i < avctx->width / 8; i++)232 for (int i = 0; i < (avctx->width + 7) / 8; i++)
233 for (int plane = 0; plane < 3; plane++) {233 for (int plane = 0; plane < 3; plane++) {
234 const VLCElem * dc_vlc = !plane ? luma_dc_vlc : chroma_dc_vlc;234 const VLCElem * dc_vlc = !plane ? luma_dc_vlc : chroma_dc_vlc;
235 int dc_bits = !plane ? LUMA_DC_BITS : CHROMA_DC_BITS;235 int dc_bits = !plane ? LUMA_DC_BITS : CHROMA_DC_BITS;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t