dev/sanitizer-fixes-20140914

Minor fixes caught by playing around with some files with a build of mpv with `-fsanitizer=address,undefined` for ffmpeg and mpv itself.
This might be better as `&&` rather than `||` since a non-zero width makes no sense with a zero height.