variable FPS incorrect frame length

I have a sample video to reproduce this bug - see attachment.

The video is in Apple Animation codec (qtrle) with variable frame rate and contains only 5 frames. Frames 1,2,4 and 5 are displayed for a very short time, but frame 3 is much longer.

When I extract all the frames into PNGs with this command:

./ffmpeg -vsync 2 -i apple-animation-variable-fps-bug.mov -vf "[in]showinfo[out]" out/img%04d.png

it's fine, I get 5 PNG files, and the timestamps shown on the output are correct:

n:0 pts:0 pts_time:0 pos:48
n:1 pts:600 pts_time:0.2 pos:4335
n:2 pts:1300 pts_time:0.433333 pos:8286
n:3 pts:7300 pts_time:2.43333 pos:12518
n:4 pts:8100 pts_time:2.7 pos:16642

as you can see, frame n:2 (the third frame) is displayed for much longer than the others. However, when I run this command to dump the frames with a constant FPS:

./ffmpeg -i apple-animation-variable-fps-bug.mov -r 30 out/img%04d.png

the frames are dumped with wrong timing. The "long" frame was 2 seconds long, so it should be in about 60 frames (with FPS 30), but instead it only gets 7 frames. But the next frame which should be very short is dumped into 60 frames. It seems that the conversion between variable FPS into constant FPS incorrectly assigns frame length into the next frame.