On Fri, Apr 19, 2013 at 11:02:34AM +0200, Nicolas BERTRAND wrote: > Le 19/04/2013 10:57, Nicolas BERTRAND a écrit : > >Le 19/04/2013 10:42, Kostya Shishkov a écrit : > >>>>>>@@ -231,8 +327,11 @@ int ff_jpeg2000_dwt_init(DWTContext *s, > >>>>>>uint16_t border[2][2], > >>>>>>> >>> case FF_DWT97: > >>>>>>> >>> s->linebuf = av_malloc((maxlen + 12) * sizeof(float)); > >>>>>>> >>> break; > >>>>>>> >>>+ case FF_DWT97_INT: > >>>>>>> >>>+ s->linebuf = av_malloc((maxlen + 12) * > >>>>>>sizeof(int32_t)); > >>>>>>> >>>+ break; > >>>>>>> >>> case FF_DWT53: > >>>>>>> >>>- s->linebuf = av_malloc((maxlen + 6) * sizeof(int)); > >>>>>>> >>>+ s->linebuf = av_malloc((maxlen + 6) * > >>>>>>sizeof(int32_t)); > >>>>> >These sizeofs should better be sizeof(*var) than sizeof(type). > >>>>So for that I have to create local variables just for sizeof? > >>of course not > >>s->linebuf = av_malloc((maxlen + 6) * sizeof(*s->linebuf)); > >And a core dump is issued > as linebuf is void*, may be change to float or int32?
Maybe it's better to make two pointers - for ints and floats even. You allocate memory only for one of them after all. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
