Skip to content

Instantly share code, notes, and snippets.

@sophiebits
Created July 8, 2011 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sophiebits/1072836 to your computer and use it in GitHub Desktop.
Save sophiebits/1072836 to your computer and use it in GitHub Desktop.
diff --git a/libavcodec/motionpixels_tablegen.h b/libavcodec/motionpixels_tablegen.h
index b56dec6..4b98530 100644
--- a/libavcodec/motionpixels_tablegen.h
+++ b/libavcodec/motionpixels_tablegen.h
@@ -30,7 +30,11 @@ typedef struct YuvPixel {
} YuvPixel;
static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) {
- static const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+ static uint8_t *cm = NULL;
+
+ if ( cm == NULL )
+ cm = ff_cropTbl + MAX_NEG_CROP;
+
int r, g, b;
r = (1000 * y + 701 * v) / 1000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment