avcodec/ivi: Check image dimensions