lavc/sunrastenc: consider cases with linesize < 0