1
0
Fork 0

avcodec/av1: don't indicate success without returning a frame

Potentially fixes an assert in generic code down the line.
This commit is contained in:
Hendrik Leppkes 2023-10-20 17:47:46 +02:00
parent cc578dd903
commit a741b8f07e
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 6 additions and 4 deletions

View File

@ -1138,7 +1138,7 @@ static int set_output_frame(AVCodecContext *avctx, AVFrame *frame)
// TODO: all layers
if (s->operating_point_idc &&
av_log2(s->operating_point_idc >> 8) > s->cur_frame.spatial_id)
return 0;
return AVERROR(EAGAIN);
ret = av_frame_ref(frame, srcframe);
if (ret < 0)
@ -1333,7 +1333,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
if (s->cur_frame.f->buf[0]) {
ret = set_output_frame(avctx, frame);
if (ret < 0)
if (ret < 0 && ret != AVERROR(EAGAIN))
av_log(avctx, AV_LOG_ERROR, "Set output frame error.\n");
}
@ -1445,11 +1445,13 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
if (s->raw_frame_header->show_frame && s->cur_frame.f->buf[0]) {
ret = set_output_frame(avctx, frame);
if (ret < 0) {
if (ret < 0 && ret != AVERROR(EAGAIN)) {
av_log(avctx, AV_LOG_ERROR, "Set output frame error\n");
goto end;
}
}
} else if (show_frame)
ret = AVERROR_INVALIDDATA;
raw_tile_group = NULL;
s->raw_frame_header = NULL;
if (show_frame) {