History

avcodec/vdpau: warn if the user application has not setup avctx->hwaccel_context instead of potentially crashing

Michael Niedermayer committed 12 years ago

Commit ec6a8551 parent 0ba887b1 file · +6 −0Browse files

Unified · Split

libavcodec/vdpau.c+6−0
@@ -83,6 +83,12 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, · 82 unmodified lines
83 uint32_t width = (avctx->coded_width + 1) & ~1;83 uint32_t width = (avctx->coded_width + 1) & ~1;
84 uint32_t height = (avctx->coded_height + 3) & ~3;84 uint32_t height = (avctx->coded_height + 3) & ~3;
85 85
86 if (!hwctx) {
87 vdctx->device = VDP_INVALID_HANDLE;
88 av_log(avctx, AV_LOG_WARNING, "hwaccel_context has not been setup by the user application, cannot initialize\n");
89 return 0;
90 }
91
86 if (hwctx->context.decoder != VDP_INVALID_HANDLE) {92 if (hwctx->context.decoder != VDP_INVALID_HANDLE) {
87 vdctx->decoder = hwctx->context.decoder;93 vdctx->decoder = hwctx->context.decoder;
88 vdctx->render = hwctx->context.render;94 vdctx->render = hwctx->context.render;

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