encode: don't segfault when bailing out due to resolution change

Somehow this code expects lastimg is always set.
This commit is contained in:
wm4
2014-11-11 17:59:03 +01:00
parent d8cd768ed0
commit 67e0230905

View File

@@ -408,7 +408,7 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
if (vc->lastipts != AV_NOPTS_VALUE) {
// we have a valid image in lastimg
while (vc->lastipts < frameipts) {
while (vc->lastimg && vc->lastipts < frameipts) {
int64_t thisduration = vc->harddup ? 1 : (frameipts - vc->lastipts);
AVPacket packet;