Fixes #9017
Unified · Split
| @@ -711,13 +711,13 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s, · 710 unmodified lines | |||
| 711 | s->bpp += byte_depth; | 711 | s->bpp += byte_depth; |
| 712 | } | 712 | } |
| 713 | 713 | ||
| 714 | if ((ret = ff_thread_get_buffer(avctx, &s->picture, AV_GET_BUFFER_FLAG_REF)) < 0) | ||
| 715 | return ret; | ||
| 716 | if (avctx->codec_id == AV_CODEC_ID_APNG && s->last_dispose_op != APNG_DISPOSE_OP_PREVIOUS) { | 714 | if (avctx->codec_id == AV_CODEC_ID_APNG && s->last_dispose_op != APNG_DISPOSE_OP_PREVIOUS) { |
| 717 | ff_thread_release_buffer(avctx, &s->previous_picture); | 715 | ff_thread_release_buffer(avctx, &s->previous_picture); |
| 718 | if ((ret = ff_thread_get_buffer(avctx, &s->previous_picture, AV_GET_BUFFER_FLAG_REF)) < 0) | 716 | if ((ret = ff_thread_get_buffer(avctx, &s->previous_picture, AV_GET_BUFFER_FLAG_REF)) < 0) |
| 719 | return ret; | 717 | return ret; |
| 720 | } | 718 | } |
| 719 | if ((ret = ff_thread_get_buffer(avctx, &s->picture, AV_GET_BUFFER_FLAG_REF)) < 0) | ||
| 720 | return ret; | ||
| 721 | p->pict_type = AV_PICTURE_TYPE_I; | 721 | p->pict_type = AV_PICTURE_TYPE_I; |
| 722 | p->key_frame = 1; | 722 | p->key_frame = 1; |
| 723 | p->interlaced_frame = !!s->interlace_type; | 723 | p->interlaced_frame = !!s->interlace_type; |