Commit 2ab6deb3 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '2cef68da'

* commit '2cef68da':
  vda: error out if decoded CVPixelBuffer is empty
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 91983971 2cef68da
...@@ -380,24 +380,25 @@ static int vda_h264_end_frame(AVCodecContext *avctx) ...@@ -380,24 +380,25 @@ static int vda_h264_end_frame(AVCodecContext *avctx)
CFRelease(coded_frame); CFRelease(coded_frame);
if (!vda->frame)
return AVERROR_UNKNOWN;
if (status != kVDADecoderNoErr) { if (status != kVDADecoderNoErr) {
av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status); av_log(avctx, AV_LOG_ERROR, "Failed to decode frame (%d)\n", status);
return AVERROR_UNKNOWN; return AVERROR_UNKNOWN;
} }
if (vda->frame) { av_buffer_unref(&frame->buf[0]);
av_buffer_unref(&frame->buf[0]);
frame->buf[0] = av_buffer_create((uint8_t*)vda->frame, frame->buf[0] = av_buffer_create((uint8_t*)vda->frame,
sizeof(vda->frame), sizeof(vda->frame),
release_buffer, NULL, release_buffer, NULL,
AV_BUFFER_FLAG_READONLY); AV_BUFFER_FLAG_READONLY);
if (!frame->buf) if (!frame->buf)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
frame->data[3] = (uint8_t*)vda->frame; frame->data[3] = (uint8_t*)vda->frame;
vda->frame = NULL; vda->frame = NULL;
}
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment