avcodec/shorten: Fix integer overflow with offset