When byte_run is 0, pixel_countdown is not touched and the loop will run forever. CC:libav-stable@libav.org