History

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

James Almer committed 1 year ago

Commit 9c55f221 parent 307983b1 file · +6 −4Browse files

Unified · Split

libavcodec/ffv1dec.c+6−4
@@ -444,14 +444,16 @@ static int decode_slice(AVCodecContext *c, void *arg) · 443 unmodified lines
444444 } else if (f->use32bit) {
445445 uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
446446 p->data[1] + ps * x + y * p->linesize[1],
447− p->data[2] + ps * x + y * p->linesize[2],
448− p->data[3] + ps * x + y * p->linesize[3] };
447+ p->data[2] + ps * x + y * p->linesize[2] };
448+ if (f->transparency)
449+ planes[3] = p->data[3] + ps * x + y * p->linesize[3];
449450 decode_rgb_frame32(f, sc, &gb, planes, width, height, p->linesize);
450451 } else {
451452 uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
452453 p->data[1] + ps * x + y * p->linesize[1],
453− p->data[2] + ps * x + y * p->linesize[2],
454− p->data[3] + ps * x + y * p->linesize[3] };
454+ p->data[2] + ps * x + y * p->linesize[2] };
455+ if (f->transparency)
456+ planes[3] = p->data[3] + ps * x + y * p->linesize[3];
455457 decode_rgb_frame(f, sc, &gb, planes, width, height, p->linesize);
456458 }
457459 if (ac != AC_GOLOMB_RICE && f->version > 2) {

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