diff options
author | wm4 <nfxjfg@googlemail.com> | 2015-08-05 19:54:41 +0200 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2015-08-06 11:05:02 +0200 |
commit | 94c0df79c7e8205b9e0ae560bc4ac831c231abb8 (patch) | |
tree | 975bfc9e70b316768b59d4f008de22f16a8b393d /libavcodec/h264_slice.c | |
parent | ace837665362297a761ca92309ece8d7f4fa725a (diff) | |
download | ffmpeg-streaming-94c0df79c7e8205b9e0ae560bc4ac831c231abb8.zip ffmpeg-streaming-94c0df79c7e8205b9e0ae560bc4ac831c231abb8.tar.gz |
lavc: propagate hwaccel errors
At least the new videotoolbox decoder does not actually set a frame if
end_frame fails. This causes the API to return success and signals that
a picture was decoded, even though AVFrame->data[0] is NULL.
Fix this by propagating end_frame errors.
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r-- | libavcodec/h264_slice.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index b088392..48f501b 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1170,15 +1170,19 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl) if (h->current_slice) { av_assert0(!h->setup_finished); if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) { - ff_h264_field_end(h, h->slice_ctx, 1); + ret = ff_h264_field_end(h, h->slice_ctx, 1); h->current_slice = 0; + if (ret < 0) + return ret; } else if (h->cur_pic_ptr && !FIELD_PICTURE(h) && !h->first_field && h->nal_unit_type == NAL_IDR_SLICE) { av_log(h, AV_LOG_WARNING, "Broken frame packetizing\n"); - ff_h264_field_end(h, h->slice_ctx, 1); + ret = ff_h264_field_end(h, h->slice_ctx, 1); h->current_slice = 0; ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0); ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1); h->cur_pic_ptr = NULL; + if (ret < 0) + return ret; } else return AVERROR_INVALIDDATA; } |