mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-28 05:30:34 +00:00
MPV: set reference frame pointers to NULL when allocation of dummy pictures fails
This commit is contained in:
parent
4a584edad7
commit
5ab506a5c8
@ -1267,8 +1267,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
/* Allocate a dummy frame */
|
||||
i = ff_find_unused_picture(s, 0);
|
||||
s->last_picture_ptr = &s->picture[i];
|
||||
if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0)
|
||||
if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
|
||||
s->last_picture_ptr = NULL;
|
||||
return -1;
|
||||
}
|
||||
ff_thread_report_progress(&s->last_picture_ptr->f, INT_MAX, 0);
|
||||
ff_thread_report_progress(&s->last_picture_ptr->f, INT_MAX, 1);
|
||||
s->last_picture_ptr->f.reference = 3;
|
||||
@ -1279,8 +1281,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
/* Allocate a dummy frame */
|
||||
i = ff_find_unused_picture(s, 0);
|
||||
s->next_picture_ptr = &s->picture[i];
|
||||
if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0)
|
||||
if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
|
||||
s->next_picture_ptr = NULL;
|
||||
return -1;
|
||||
}
|
||||
ff_thread_report_progress(&s->next_picture_ptr->f, INT_MAX, 0);
|
||||
ff_thread_report_progress(&s->next_picture_ptr->f, INT_MAX, 1);
|
||||
s->next_picture_ptr->f.reference = 3;
|
||||
|
Loading…
Reference in New Issue
Block a user