Advertisement
Guest User

Untitled

a guest
Mar 1st, 2018
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.35 KB | None | 0 0
  1. @@ -642,9 +639,9 @@ AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane)
  2.      return NULL;
  3.  }
  4.  
  5. -static AVFrameSideData *frame_new_side_data(AVFrame *frame,
  6. -                                            enum AVFrameSideDataType type,
  7. -                                            AVBufferRef *buf)
  8. +AVFrameSideData *av_frame_new_side_data_from_buf(AVFrame *frame,
  9. +                                                 enum AVFrameSideDataType type,
  10. +                                                 AVBufferRef *buf)
  11.  {
  12.      AVFrameSideData *ret, **tmp;
  13.  
  14. @@ -652,17 +649,17 @@ static AVFrameSideData *frame_new_side_data(AVFrame *frame,
  15.          return NULL;
  16.  
  17.      if (frame->nb_side_data > INT_MAX / sizeof(*frame->side_data) - 1)
  18. -        goto fail;
  19. +        return NULL;
  20.  
  21.      tmp = av_realloc(frame->side_data,
  22.                       (frame->nb_side_data + 1) * sizeof(*frame->side_data));
  23.      if (!tmp)
  24. -        goto fail;
  25. +        return NULL;
  26.      frame->side_data = tmp;
  27.  
  28.      ret = av_mallocz(sizeof(*ret));
  29.      if (!ret)
  30. -        goto fail;
  31. +        return NULL;
  32.  
  33.      ret->buf = buf;
  34.      ret->data = ret->buf->data;
  35. @@ -672,17 +669,18 @@ static AVFrameSideData *frame_new_side_data(AVFrame *frame,
  36.      frame->side_data[frame->nb_side_data++] = ret;
  37.  
  38.      return ret;
  39. -fail:
  40. -    av_buffer_unref(&buf);
  41. -    return NULL;
  42.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement