]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qpeg.c
avcodec/version: Bump micro-version for nvdec/cuviddec changes
[ffmpeg] / libavcodec / qpeg.c
index e1210c197206024e95915f38688c87b08694eca4..654fd998d6abb11efaa7546ca3f7518dfe6b5dd0 100644 (file)
@@ -80,11 +80,20 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst,
 
             p = bytestream2_get_byte(&qctx->buffer);
             for(i = 0; i < run; i++) {
-                dst[filled++] = p;
+                int step = FFMIN(run - i, width - filled);
+                memset(dst+filled, p, step);
+                filled += step;
+                i      += step - 1;
                 if (filled >= width) {
                     filled = 0;
                     dst -= stride;
                     rows_to_go--;
+                    while (run - i > width && rows_to_go > 0) {
+                        memset(dst, p, width);
+                        dst -= stride;
+                        rows_to_go--;
+                        i += width;
+                    }
                     if(rows_to_go <= 0)
                         break;
                 }