Otherwise the generic code will unref them, which can then result in
last_picture_ptr == current_picture_ptr, which causes deadlocks at least
in rv40.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
return i;
}
s->last_picture_ptr = &s->picture[i];
+
+ s->last_picture_ptr->reference = 3;
+ s->last_picture_ptr->f.pict_type = AV_PICTURE_TYPE_I;
+
if (ff_alloc_picture(s, s->last_picture_ptr, 0) < 0) {
s->last_picture_ptr = NULL;
return -1;
return i;
}
s->next_picture_ptr = &s->picture[i];
+
+ s->next_picture_ptr->reference = 3;
+ s->next_picture_ptr->f.pict_type = AV_PICTURE_TYPE_I;
+
if (ff_alloc_picture(s, s->next_picture_ptr, 0) < 0) {
s->next_picture_ptr = NULL;
return -1;