jpegls: return meaningful errors

(cherry picked from commit a5a0ef5e13)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavcodec/jpeglsdec.c
This commit is contained in:
Luca Barbato
2013-05-17 12:36:06 +02:00
committed by Reinhard Tartler
parent 7f451cb01f
commit 9eecf633f7

View File

@@ -70,13 +70,13 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
case 2: case 2:
case 3: case 3:
av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n"); av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n");
return -1; return AVERROR(ENOSYS);
case 4: case 4:
av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n"); av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n");
return -1; return AVERROR(ENOSYS);
default: default:
av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id); av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
return -1; return AVERROR_INVALIDDATA;
} }
av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3); av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
@@ -327,11 +327,11 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
last = cur; last = cur;
cur += s->picture_ptr->linesize[0]; cur += s->picture_ptr->linesize[0];
} }
} else if(ilv == 2) { /* sample interleaving */ } else if (ilv == 2) { /* sample interleaving */
av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n"); av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
av_free(state); av_free(state);
av_free(zero); av_free(zero);
return -1; return AVERROR_PATCHWELCOME;
} }
if(shift){ /* we need to do point transform or normalize samples */ if(shift){ /* we need to do point transform or normalize samples */