Have a look at find_image_format():

    if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == 0) {
        *pdrv = &bdrv_raw;
        return ret;
    }

blk_getlength() can fail.  Shouldn't we error out then?

We pretty obviously should in img_map():

    length = blk_getlength(blk);
    while (curr.start + curr.length < length) {

Since I have to touch @length in the series I'm working on, I'll stick
in a fix.

Reply via email to