<div dir="ltr"><div>   //begin relevant code here</div><div>   mSwsContext  = sws_getContext(input_width,</div><div>                                 input_height,</div><div>                                 input_pixel_format,</div>
<div>                                 output_width,</div><div>                                 output_height,</div><div>                                 output_pixel_format,</div><div>                                 SWS_BICUBIC,</div>
<div>                                 NULL,</div><div>                                 NULL,</div><div>                                 NULL);</div><div><br></div><div>   AVPicture input_picture;</div><div>   avpicture_alloc(&input_picture,</div>
<div>                   input_pixel_format, //AV_PIX_FMT_BGR24</div><div>                   input_width, //656</div><div>                   input_height); //354</div><div><br></div><div>   ret = avpicture_fill(&input_picture,</div>
<div>                        data,</div><div>                        input_pixel_format,</div><div>                        input_width,</div><div>                        input_height);</div><div><br></div><div>   AVPicture output_picture;</div>
<div>   avpicture_alloc(&output_picture,</div><div>                   output_pixel_format,</div><div>                   output_width,</div><div>                   output_height);</div><div><br></div><div>   if (mSwsContext != NULL)</div>
<div>   {</div><div>      ret = sws_scale(mSwsContext,</div><div>                      input_picture.data,</div><div>                      input_picture.linesize,</div><div>                      0,</div><div>                      input_height,</div>
<div>                      output_picture.data,</div><div>                      output_picture.linesize);</div><div><br></div><div>      //ret here is always 0</div><div>   }</div><div><br></div><div>   //etc....</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 23, 2013 at 10:21 AM, Neil Menne <span dir="ltr"><<a href="mailto:nhmenne42@students.tntech.edu" target="_blank">nhmenne42@students.tntech.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm trying to convert a raw image that I receive as a unsigned character array. I then create (via avpicture_alloc) two AVPictures (one for the source and one for the destination). I then do an avpicture_fill for the input using the unsigned character array. The value returned by avpicture_fill matches the size of the original image.<div>

<br></div><div>When I do the sws_scale, I get a printout saying "bad src image pointers" which comes from the check_image_pointers function in sws_scale. My question is this: How is this happening? I'm filling an allocated picture. Where is the disconnect?<div>

<br></div><div>Thanks in advance, guys.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Neil</div></font></span></div><div><br></div><div>P.S. here's the relevant snippet of code</div><div><br></div>
</div>
</blockquote></div><br></div>