[FFmpeg-devel] [PATCH] instead of crashing print warning for MJPEG flipped + CODEC_FLAG_EMU_EDGE
Reimar Döffinger
Reimar.Doeffinger
Tue Nov 17 15:35:28 CET 2009
Hello,
completely failing would be another option, but simply crashing or even
just asserting due to missing padding if an application uses
CODEC_FLAG_EMU_EDGE IMO is not acceptable.
Possibly an extra flag in the context to print this warning only once
would make sense (or would a static variable be ok as well?).
Index: mjpegdec.c
===================================================================
--- mjpegdec.c (revision 20530)
+++ mjpegdec.c (working copy)
@@ -770,6 +770,10 @@
uint8_t* data[MAX_COMPONENTS];
int linesize[MAX_COMPONENTS];
+ if(s->flipped && s->avctx->flags & CODEC_FLAG_EMU_EDGE) {
+ av_log(s->avctx, AV_LOG_ERROR, "Can not flip image with CODEC_FLAG_EMU_EDGE set!\n");
+ s->flipped = 0;
+ }
for(i=0; i < nb_components; i++) {
int c = s->comp_index[i];
data[c] = s->picture.data[c];
@@ -777,7 +781,6 @@
s->coefs_finished[c] |= 1;
if(s->flipped) {
//picture should be flipped upside-down for this codec
- assert(!(s->avctx->flags & CODEC_FLAG_EMU_EDGE));
data[c] += (linesize[c] * (s->v_scount[i] * (8 * s->mb_height -((s->height/s->v_max)&7)) - 1 ));
linesize[c] *= -1;
}
More information about the ffmpeg-devel
mailing list