History

pgssubdec: fix API compability layer

Copy pointers to AVPicture after memory has been allocated. Fixes NULL pointers in AVPicture after a17a7661906ba295d67afd80ac0770422e1b02b3.

Petri Hintukainen committed 10 years ago

Commit 71394891 parent b0e86511 file · +10 −10Browse files

Unified · Split

libavcodec/pgssubdec.c+10−10
@@ -543,16 +543,6 @@ static int display_end_segment(AVCodecContext *avctx, void *data, · 542 unmodified lines
543 543
544 sub->rects[i]->linesize[0] = object->w;544 sub->rects[i]->linesize[0] = object->w;
545 545
546#if FF_API_AVPICTURE
547FF_DISABLE_DEPRECATION_WARNINGS
548 rect = sub->rects[i];
549 for (j = 0; j < 4; j++) {
550 rect->pict.data[j] = rect->data[j];
551 rect->pict.linesize[j] = rect->linesize[j];
552 }
553FF_ENABLE_DEPRECATION_WARNINGS
554#endif
555
556 if (object->rle) {546 if (object->rle) {
557 if (object->rle_remaining_len) {547 if (object->rle_remaining_len) {
558 av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",548 av_log(avctx, AV_LOG_ERROR, "RLE data length %u is %u bytes shorter than expected\n",
@@ -582,6 +572,16 @@ FF_ENABLE_DEPRECATION_WARNINGS · 23 unmodified lines
582 return AVERROR(ENOMEM);572 return AVERROR(ENOMEM);
583 }573 }
584 574
575#if FF_API_AVPICTURE
576FF_DISABLE_DEPRECATION_WARNINGS
577 rect = sub->rects[i];
578 for (j = 0; j < 4; j++) {
579 rect->pict.data[j] = rect->data[j];
580 rect->pict.linesize[j] = rect->linesize[j];
581 }
582FF_ENABLE_DEPRECATION_WARNINGS
583#endif
584
585 memcpy(sub->rects[i]->data[1], palette->clut, sub->rects[i]->nb_colors * sizeof(uint32_t));585 memcpy(sub->rects[i]->data[1], palette->clut, sub->rects[i]->nb_colors * sizeof(uint32_t));
586 586
587 }587 }

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