libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
authorPhilip DeCamp <decamp@mit.edu>
Wed, 24 Sep 2014 20:15:18 +0000 (16:15 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Oct 2014 01:40:59 +0000 (03:40 +0200)
Signed-off-by: Philip DeCamp <decamp@mit.edu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 857fc0a71f1b52fbba3281ba64b5a35195458622)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/opt.c

index 694295d..4115484 100644 (file)
@@ -631,7 +631,7 @@ int av_opt_set_channel_layout(void *obj, const char *name, int64_t cl, int searc
                "The value set by option '%s' is not a channel layout.\n", o->name);
         return AVERROR(EINVAL);
     }
-    *(int *)(((int64_t *)target_obj) + o->offset) = cl;
+    *(int64_t *)(((uint8_t *)target_obj) + o->offset) = cl;
     return 0;
 }