History

avcodec/ffv1dec: don't add offsets to more NULL pointers

James Almer committed 1 year ago

Commit 48ef4ca1 parent 080dc4c1 file · +10 −6Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/ffv1dec.c+10−6
@@ -447,16 +447,20 @@ static int decode_slice(AVCodecContext *c, void *arg) · 446 unmodified lines
447447 decode_plane(f, sc, &gb, p->data[0] + ps*x + y*p->linesize[0] , width, height, p->linesize[0], 0, 0, 2, ac);
448448 decode_plane(f, sc, &gb, p->data[0] + ps*x + y*p->linesize[0] + (ps>>1), width, height, p->linesize[0], 1, 1, 2, ac);
449449 } else if (f->use32bit) {
450− uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
451− p->data[1] + ps * x + y * p->linesize[1],
452− p->data[2] + ps * x + y * p->linesize[2] };
450+ uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0] };
451+ if (f->chroma_planes) {
452+ planes[1] = p->data[1] + ps * x + y * p->linesize[1];
453+ planes[2] = p->data[2] + ps * x + y * p->linesize[2];
454+ }
453455 if (f->transparency)
454456 planes[3] = p->data[3] + ps * x + y * p->linesize[3];
455457 decode_rgb_frame32(f, sc, &gb, planes, width, height, p->linesize);
456458 } else {
457− uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
458− p->data[1] + ps * x + y * p->linesize[1],
459− p->data[2] + ps * x + y * p->linesize[2] };
459+ uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0] };
460+ if (f->chroma_planes) {
461+ planes[1] = p->data[1] + ps * x + y * p->linesize[1];
462+ planes[2] = p->data[2] + ps * x + y * p->linesize[2];
463+ }
460464 if (f->transparency)
461465 planes[3] = p->data[3] + ps * x + y * p->linesize[3];
462466 decode_rgb_frame(f, sc, &gb, planes, width, height, p->linesize);

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