avcodec/mjpegenc: Use av_frame_clone() instead of av_frame_ref()

This avoids the need for double error checking
Fixes CID1163843

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/libopenjpegenc: Replace av_frame_alloc() and av_frame_ref() by av_frame_clone()

Simplifies code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vc1: fix type of tmp

Fixes CID1163850
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>